Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: BCM47XX: add bcm47xx prefix in front of nvram function names

The nvram functions are exported and used by some normal drivers. To
prevent name clashes with ofter parts of the kernel code add a bcm47xx_
prefix in front of the function names and the header file name.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Patchwork: http://patchwork.linux-mips.org/patch/4744/
Signed-off-by: John Crispin <blogic@openwrt.org>

authored by

Hauke Mehrtens and committed by
John Crispin
111bd981 f36738dd

+23 -23
+3 -3
arch/mips/bcm47xx/nvram.c
··· 18 18 #include <linux/kernel.h> 19 19 #include <linux/string.h> 20 20 #include <asm/addrspace.h> 21 - #include <asm/mach-bcm47xx/nvram.h> 21 + #include <bcm47xx_nvram.h> 22 22 #include <asm/mach-bcm47xx/bcm47xx.h> 23 23 24 24 static char nvram_buf[NVRAM_SPACE]; ··· 159 159 return -ENXIO; 160 160 } 161 161 162 - int nvram_getenv(char *name, char *val, size_t val_len) 162 + int bcm47xx_nvram_getenv(char *name, char *val, size_t val_len) 163 163 { 164 164 char *var, *value, *end, *eq; 165 165 int err; ··· 189 189 } 190 190 return -ENOENT; 191 191 } 192 - EXPORT_SYMBOL(nvram_getenv); 192 + EXPORT_SYMBOL(bcm47xx_nvram_getenv);
+3 -3
arch/mips/bcm47xx/setup.c
··· 35 35 #include <asm/reboot.h> 36 36 #include <asm/time.h> 37 37 #include <bcm47xx.h> 38 - #include <asm/mach-bcm47xx/nvram.h> 38 + #include <bcm47xx_nvram.h> 39 39 40 40 union bcm47xx_bus bcm47xx_bus; 41 41 EXPORT_SYMBOL(bcm47xx_bus); ··· 115 115 memset(&iv->sprom, 0, sizeof(struct ssb_sprom)); 116 116 bcm47xx_fill_sprom(&iv->sprom, NULL, false); 117 117 118 - if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0) 118 + if (bcm47xx_nvram_getenv("cardbus", buf, sizeof(buf)) >= 0) 119 119 iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10); 120 120 121 121 return 0; ··· 138 138 panic("Failed to initialize SSB bus (err %d)", err); 139 139 140 140 mcore = &bcm47xx_bus.ssb.mipscore; 141 - if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) { 141 + if (bcm47xx_nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) { 142 142 if (strstr(buf, "console=ttyS1")) { 143 143 struct ssb_serial_port port; 144 144
+4 -4
arch/mips/bcm47xx/sprom.c
··· 27 27 */ 28 28 29 29 #include <bcm47xx.h> 30 - #include <nvram.h> 30 + #include <bcm47xx_nvram.h> 31 31 32 32 static void create_key(const char *prefix, const char *postfix, 33 33 const char *name, char *buf, int len) ··· 50 50 51 51 create_key(prefix, postfix, name, key, sizeof(key)); 52 52 53 - err = nvram_getenv(key, buf, len); 53 + err = bcm47xx_nvram_getenv(key, buf, len); 54 54 if (fallback && err == -ENOENT && prefix) { 55 55 create_key(NULL, postfix, name, key, sizeof(key)); 56 - err = nvram_getenv(key, buf, len); 56 + err = bcm47xx_nvram_getenv(key, buf, len); 57 57 } 58 58 return err; 59 59 } ··· 144 144 if (err < 0) 145 145 return; 146 146 147 - nvram_parse_macaddr(buf, *val); 147 + bcm47xx_nvram_parse_macaddr(buf, *val); 148 148 } 149 149 150 150 static void nvram_read_alpha2(const char *prefix, const char *name,
+5 -5
arch/mips/include/asm/mach-bcm47xx/nvram.h arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
··· 8 8 * option) any later version. 9 9 */ 10 10 11 - #ifndef __NVRAM_H 12 - #define __NVRAM_H 11 + #ifndef __BCM47XX_NVRAM_H 12 + #define __BCM47XX_NVRAM_H 13 13 14 14 #include <linux/types.h> 15 15 #include <linux/kernel.h> ··· 32 32 #define NVRAM_MAX_VALUE_LEN 255 33 33 #define NVRAM_MAX_PARAM_LEN 64 34 34 35 - extern int nvram_getenv(char *name, char *val, size_t val_len); 35 + extern int bcm47xx_nvram_getenv(char *name, char *val, size_t val_len); 36 36 37 - static inline void nvram_parse_macaddr(char *buf, u8 macaddr[6]) 37 + static inline void bcm47xx_nvram_parse_macaddr(char *buf, u8 macaddr[6]) 38 38 { 39 39 if (strchr(buf, ':')) 40 40 sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0], ··· 48 48 printk(KERN_WARNING "Can not parse mac address: %s\n", buf); 49 49 } 50 50 51 - #endif 51 + #endif /* __BCM47XX_NVRAM_H */
+1 -1
drivers/mtd/bcm47xxpart.c
··· 14 14 #include <linux/slab.h> 15 15 #include <linux/mtd/mtd.h> 16 16 #include <linux/mtd/partitions.h> 17 - #include <asm/mach-bcm47xx/nvram.h> 17 + #include <bcm47xx_nvram.h> 18 18 19 19 /* 10 parts were found on sflash on Netgear WNDR4500 */ 20 20 #define BCM47XXPART_MAX_PARTS 12
+2 -2
drivers/net/ethernet/broadcom/b44.c
··· 381 381 } 382 382 383 383 #ifdef CONFIG_BCM47XX 384 - #include <asm/mach-bcm47xx/nvram.h> 384 + #include <bcm47xx_nvram.h> 385 385 static void b44_wap54g10_workaround(struct b44 *bp) 386 386 { 387 387 char buf[20]; ··· 393 393 * see https://dev.openwrt.org/ticket/146 394 394 * check and reset bit "isolate" 395 395 */ 396 - if (nvram_getenv("boardnum", buf, sizeof(buf)) < 0) 396 + if (bcm47xx_nvram_getenv("boardnum", buf, sizeof(buf)) < 0) 397 397 return; 398 398 if (simple_strtoul(buf, NULL, 0) == 2) { 399 399 err = __b44_readphy(bp, 0, MII_BMCR, &val);
+2 -2
drivers/ssb/driver_chipcommon_pmu.c
··· 14 14 #include <linux/delay.h> 15 15 #include <linux/export.h> 16 16 #ifdef CONFIG_BCM47XX 17 - #include <asm/mach-bcm47xx/nvram.h> 17 + #include <bcm47xx_nvram.h> 18 18 #endif 19 19 20 20 #include "ssb_private.h" ··· 322 322 if (bus->bustype == SSB_BUSTYPE_SSB) { 323 323 #ifdef CONFIG_BCM47XX 324 324 char buf[20]; 325 - if (nvram_getenv("xtalfreq", buf, sizeof(buf)) >= 0) 325 + if (bcm47xx_nvram_getenv("xtalfreq", buf, sizeof(buf)) >= 0) 326 326 crystalfreq = simple_strtoul(buf, NULL, 0); 327 327 #endif 328 328 }
+3 -3
include/linux/ssb/ssb_driver_gige.h
··· 98 98 } 99 99 100 100 #ifdef CONFIG_BCM47XX 101 - #include <asm/mach-bcm47xx/nvram.h> 101 + #include <bcm47xx_nvram.h> 102 102 /* Get the device MAC address */ 103 103 static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) 104 104 { 105 105 char buf[20]; 106 - if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0) 106 + if (bcm47xx_nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0) 107 107 return; 108 - nvram_parse_macaddr(buf, macaddr); 108 + bcm47xx_nvram_parse_macaddr(buf, macaddr); 109 109 } 110 110 #else 111 111 static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)