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>
This commit is contained in:

gecommit door
Greg Kroah-Hartman

bovenliggende
458c77f3de
commit
d3b41b6bb4
@@ -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;
|
||||
|
Verwijs in nieuw issue
Block a user