summaryrefslogtreecommitdiff
path: root/arch/m68k/atari
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2019-01-15 15:18:56 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-22 10:21:45 +0100
commitd3b41b6bb49ecbf74b6bda63e00bf17fdb4d3c47 (patch)
treea5b0f31d8348dbce9b22a014f0b3a1028f9e362c /arch/m68k/atari
parent458c77f3de0edc8a2df1f54ac641823ccbd3ff56 (diff)
m68k: Dispatch nvram_ops calls to Atari or Mac functions
A multi-platform kernel binary has to decide at run-time how to dispatch the arch_nvram_ops calls. Add a platform-independent arch_nvram_ops struct for this, to replace the atari-specific one. Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs. Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/m68k/atari')
-rw-r--r--arch/m68k/atari/nvram.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/arch/m68k/atari/nvram.c b/arch/m68k/atari/nvram.c
index c347fd206ddf..7000d2443aa3 100644
--- a/arch/m68k/atari/nvram.c
+++ b/arch/m68k/atari/nvram.c
@@ -74,7 +74,7 @@ static void __nvram_set_checksum(void)
__nvram_write_byte(sum, ATARI_CKS_LOC + 1);
}
-static long atari_nvram_set_checksum(void)
+long atari_nvram_set_checksum(void)
{
spin_lock_irq(&rtc_lock);
__nvram_set_checksum();
@@ -82,7 +82,7 @@ static long atari_nvram_set_checksum(void)
return 0;
}
-static long atari_nvram_initialize(void)
+long atari_nvram_initialize(void)
{
loff_t i;
@@ -94,7 +94,7 @@ static long atari_nvram_initialize(void)
return 0;
}
-static ssize_t atari_nvram_read(char *buf, size_t count, loff_t *ppos)
+ssize_t atari_nvram_read(char *buf, size_t count, loff_t *ppos)
{
char *p = buf;
loff_t i;
@@ -112,7 +112,7 @@ static ssize_t atari_nvram_read(char *buf, size_t count, loff_t *ppos)
return p - buf;
}
-static ssize_t atari_nvram_write(char *buf, size_t count, loff_t *ppos)
+ssize_t atari_nvram_write(char *buf, size_t count, loff_t *ppos)
{
char *p = buf;
loff_t i;
@@ -131,22 +131,11 @@ static ssize_t atari_nvram_write(char *buf, size_t count, loff_t *ppos)
return p - buf;
}
-static ssize_t atari_nvram_get_size(void)
+ssize_t atari_nvram_get_size(void)
{
- if (!MACH_IS_ATARI)
- return -ENODEV;
return NVRAM_BYTES;
}
-const struct nvram_ops arch_nvram_ops = {
- .read = atari_nvram_read,
- .write = atari_nvram_write,
- .get_size = atari_nvram_get_size,
- .set_checksum = atari_nvram_set_checksum,
- .initialize = atari_nvram_initialize,
-};
-EXPORT_SYMBOL(arch_nvram_ops);
-
#ifdef CONFIG_PROC_FS
static struct {
unsigned char val;