aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-12-26 14:51:14 -0500
committerJohn Crispin <blogic@openwrt.org>2013-02-15 13:01:57 -0500
commit111bd981e2216827aab95503596501ab71bc7a7d (patch)
treeb4895d5923bd065ab1dfa74cae893c24c97bc340 /arch
parentf36738ddfeea02867b393e7f34da0cec48bafc54 (diff)
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/bcm47xx/nvram.c6
-rw-r--r--arch/mips/bcm47xx/setup.c6
-rw-r--r--arch/mips/bcm47xx/sprom.c8
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h (renamed from arch/mips/include/asm/mach-bcm47xx/nvram.h)10
4 files changed, 15 insertions, 15 deletions
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index b4a47fcb4f64..e63bd5abd9a2 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
@@ -18,7 +18,7 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/string.h> 19#include <linux/string.h>
20#include <asm/addrspace.h> 20#include <asm/addrspace.h>
21#include <asm/mach-bcm47xx/nvram.h> 21#include <bcm47xx_nvram.h>
22#include <asm/mach-bcm47xx/bcm47xx.h> 22#include <asm/mach-bcm47xx/bcm47xx.h>
23 23
24static char nvram_buf[NVRAM_SPACE]; 24static char nvram_buf[NVRAM_SPACE];
@@ -159,7 +159,7 @@ static int nvram_init(void)
159 return -ENXIO; 159 return -ENXIO;
160} 160}
161 161
162int nvram_getenv(char *name, char *val, size_t val_len) 162int bcm47xx_nvram_getenv(char *name, char *val, size_t val_len)
163{ 163{
164 char *var, *value, *end, *eq; 164 char *var, *value, *end, *eq;
165 int err; 165 int err;
@@ -189,4 +189,4 @@ int nvram_getenv(char *name, char *val, size_t val_len)
189 } 189 }
190 return -ENOENT; 190 return -ENOENT;
191} 191}
192EXPORT_SYMBOL(nvram_getenv); 192EXPORT_SYMBOL(bcm47xx_nvram_getenv);
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 4d54b58dbd32..b2246cd9ca12 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -35,7 +35,7 @@
35#include <asm/reboot.h> 35#include <asm/reboot.h>
36#include <asm/time.h> 36#include <asm/time.h>
37#include <bcm47xx.h> 37#include <bcm47xx.h>
38#include <asm/mach-bcm47xx/nvram.h> 38#include <bcm47xx_nvram.h>
39 39
40union bcm47xx_bus bcm47xx_bus; 40union bcm47xx_bus bcm47xx_bus;
41EXPORT_SYMBOL(bcm47xx_bus); 41EXPORT_SYMBOL(bcm47xx_bus);
@@ -115,7 +115,7 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
115 memset(&iv->sprom, 0, sizeof(struct ssb_sprom)); 115 memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
116 bcm47xx_fill_sprom(&iv->sprom, NULL, false); 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 iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10); 119 iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10);
120 120
121 return 0; 121 return 0;
@@ -138,7 +138,7 @@ static void __init bcm47xx_register_ssb(void)
138 panic("Failed to initialize SSB bus (err %d)", err); 138 panic("Failed to initialize SSB bus (err %d)", err);
139 139
140 mcore = &bcm47xx_bus.ssb.mipscore; 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 if (strstr(buf, "console=ttyS1")) { 142 if (strstr(buf, "console=ttyS1")) {
143 struct ssb_serial_port port; 143 struct ssb_serial_port port;
144 144
diff --git a/arch/mips/bcm47xx/sprom.c b/arch/mips/bcm47xx/sprom.c
index 66b71c363300..89b9bf46b13b 100644
--- a/arch/mips/bcm47xx/sprom.c
+++ b/arch/mips/bcm47xx/sprom.c
@@ -27,7 +27,7 @@
27 */ 27 */
28 28
29#include <bcm47xx.h> 29#include <bcm47xx.h>
30#include <nvram.h> 30#include <bcm47xx_nvram.h>
31 31
32static void create_key(const char *prefix, const char *postfix, 32static void create_key(const char *prefix, const char *postfix,
33 const char *name, char *buf, int len) 33 const char *name, char *buf, int len)
@@ -50,10 +50,10 @@ static int get_nvram_var(const char *prefix, const char *postfix,
50 50
51 create_key(prefix, postfix, name, key, sizeof(key)); 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 if (fallback && err == -ENOENT && prefix) { 54 if (fallback && err == -ENOENT && prefix) {
55 create_key(NULL, postfix, name, key, sizeof(key)); 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 return err; 58 return err;
59} 59}
@@ -144,7 +144,7 @@ static void nvram_read_macaddr(const char *prefix, const char *name,
144 if (err < 0) 144 if (err < 0)
145 return; 145 return;
146 146
147 nvram_parse_macaddr(buf, *val); 147 bcm47xx_nvram_parse_macaddr(buf, *val);
148} 148}
149 149
150static void nvram_read_alpha2(const char *prefix, const char *name, 150static void nvram_read_alpha2(const char *prefix, const char *name,
diff --git a/arch/mips/include/asm/mach-bcm47xx/nvram.h b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
index 550a7fc932c9..b8e7be8f34dd 100644
--- a/arch/mips/include/asm/mach-bcm47xx/nvram.h
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
@@ -8,8 +8,8 @@
8 * option) any later version. 8 * option) any later version.
9 */ 9 */
10 10
11#ifndef __NVRAM_H 11#ifndef __BCM47XX_NVRAM_H
12#define __NVRAM_H 12#define __BCM47XX_NVRAM_H
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
@@ -32,9 +32,9 @@ struct nvram_header {
32#define NVRAM_MAX_VALUE_LEN 255 32#define NVRAM_MAX_VALUE_LEN 255
33#define NVRAM_MAX_PARAM_LEN 64 33#define NVRAM_MAX_PARAM_LEN 64
34 34
35extern int nvram_getenv(char *name, char *val, size_t val_len); 35extern int bcm47xx_nvram_getenv(char *name, char *val, size_t val_len);
36 36
37static inline void nvram_parse_macaddr(char *buf, u8 macaddr[6]) 37static inline void bcm47xx_nvram_parse_macaddr(char *buf, u8 macaddr[6])
38{ 38{
39 if (strchr(buf, ':')) 39 if (strchr(buf, ':'))
40 sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0], 40 sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0],
@@ -48,4 +48,4 @@ static inline void nvram_parse_macaddr(char *buf, u8 macaddr[6])
48 printk(KERN_WARNING "Can not parse mac address: %s\n", buf); 48 printk(KERN_WARNING "Can not parse mac address: %s\n", buf);
49} 49}
50 50
51#endif 51#endif /* __BCM47XX_NVRAM_H */