powerpc: Replace nvram_* extern declarations with standard header
authorFinn Thain <fthain@telegraphics.com.au>
Tue, 15 Jan 2019 04:18:56 +0000 (15:18 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 09:21:43 +0000 (10:21 +0100)
Remove the nvram_read_byte() and nvram_write_byte() declarations in
powerpc/include/asm/nvram.h and use the cross-platform static functions
in linux/nvram.h instead.

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>
arch/powerpc/include/asm/nvram.h
arch/powerpc/kernel/setup_32.c
drivers/char/generic_nvram.c
drivers/video/fbdev/matrox/matroxfb_base.c
include/linux/nvram.h

index 09a518bb7c03c681a776e708f78642446b4ecbb4..56a388da9c4f2417e49d106f2c74340c11261213 100644 (file)
@@ -98,10 +98,4 @@ extern int nvram_write_os_partition(struct nvram_os_partition *part,
                                    unsigned int err_type,
                                    unsigned int error_log_cnt);
 
-/* Determine NVRAM size */
-extern ssize_t nvram_get_size(void);
-
-/* Normal access to NVRAM */
-extern unsigned char nvram_read_byte(int i);
-extern void nvram_write_byte(unsigned char c, int i);
 #endif /* _ASM_POWERPC_NVRAM_H */
index 947f904688b0e9d6e8bdb06ef31f571fbb85e415..f5107796e2d79338d0c2ed4f2104804f5d95cc29 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/console.h>
 #include <linux/memblock.h>
 #include <linux/export.h>
+#include <linux/nvram.h>
 
 #include <asm/io.h>
 #include <asm/prom.h>
@@ -149,30 +150,6 @@ __setup("l3cr=", ppc_setup_l3cr);
 
 #ifdef CONFIG_GENERIC_NVRAM
 
-/* Generic nvram hooks used by drivers/char/gen_nvram.c */
-unsigned char nvram_read_byte(int addr)
-{
-       if (ppc_md.nvram_read_val)
-               return ppc_md.nvram_read_val(addr);
-       return 0xff;
-}
-EXPORT_SYMBOL(nvram_read_byte);
-
-void nvram_write_byte(unsigned char val, int addr)
-{
-       if (ppc_md.nvram_write_val)
-               ppc_md.nvram_write_val(addr, val);
-}
-EXPORT_SYMBOL(nvram_write_byte);
-
-ssize_t nvram_get_size(void)
-{
-       if (ppc_md.nvram_size)
-               return ppc_md.nvram_size();
-       return -1;
-}
-EXPORT_SYMBOL(nvram_get_size);
-
 void nvram_sync(void)
 {
        if (ppc_md.nvram_sync)
index ff5394f475875b6fe0c666d760a1a45daae8a0db..0c22b9503e84d4a72b7cee3f6123d42815a45fb5 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/fcntl.h>
 #include <linux/init.h>
 #include <linux/mutex.h>
+#include <linux/nvram.h>
 #include <linux/pagemap.h>
 #include <linux/uaccess.h>
 #include <asm/nvram.h>
index 838869c6490c2e4dcf87a4b35d5103d62976657b..0a4e5bad33f4881fff1ece30aeecae530736a465 100644 (file)
 #include "matroxfb_g450.h"
 #include <linux/matroxfb.h>
 #include <linux/interrupt.h>
+#include <linux/nvram.h>
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 
 #ifdef CONFIG_PPC_PMAC
 #include <asm/machdep.h>
-unsigned char nvram_read_byte(int);
 static int default_vmode = VMODE_NVRAM;
 static int default_cmode = CMODE_NVRAM;
 #endif
index a1e01dc8975906af2c9301704f5d62d9e2563d4f..79431dab87a1cfbaf5eb4de3c864d371395200af 100644 (file)
@@ -15,8 +15,11 @@ extern const struct nvram_ops arch_nvram_ops;
 
 static inline ssize_t nvram_get_size(void)
 {
+#ifdef CONFIG_PPC
+#else
        if (arch_nvram_ops.get_size)
                return arch_nvram_ops.get_size();
+#endif
        return -ENODEV;
 }