Commit 3f7e0c5d authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: replace simple_strtoul usage in brcmsmac

The usage of simple_strtoul is not preferred. Instead kstrtoul
should be used. This patch fixes this for the brcmsmac driver.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1fda276e
...@@ -4287,16 +4287,17 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -4287,16 +4287,17 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
#endif #endif
if (bustype != SI_BUS) { if (bustype != SI_BUS) {
char *var; char *var;
unsigned long res;
var = getvar(vars, "vendid"); var = getvar(vars, "vendid");
if (var) { if (var && !kstrtoul(var, 0, &res)) {
vendor = (u16) simple_strtoul(var, NULL, 0); vendor = (u16)res;
wiphy_err(wiphy, "Overriding vendor id = 0x%x\n", wiphy_err(wiphy, "Overriding vendor id = 0x%x\n",
vendor); vendor);
} }
var = getvar(vars, "devid"); var = getvar(vars, "devid");
if (var) { if (var && !kstrtoul(var, 0, &res)) {
u16 devid = (u16) simple_strtoul(var, NULL, 0); u16 devid = (u16)res;
if (devid != 0xffff) { if (devid != 0xffff) {
device = devid; device = devid;
wiphy_err(wiphy, "Overriding device id = 0x%x" wiphy_err(wiphy, "Overriding device id = 0x%x"
...@@ -9596,10 +9597,11 @@ char *getvar(char *vars, const char *name) ...@@ -9596,10 +9597,11 @@ char *getvar(char *vars, const char *name)
int getintvar(char *vars, const char *name) int getintvar(char *vars, const char *name)
{ {
char *val; char *val;
unsigned long res;
val = getvar(vars, name); val = getvar(vars, name);
if (val == NULL) if (val && !kstrtoul(val, 0, &res))
return 0; return res;
return simple_strtoul(val, NULL, 0); return 0;
} }
...@@ -174,12 +174,13 @@ char *phy_getvar(struct brcms_phy *pi, const char *name) ...@@ -174,12 +174,13 @@ char *phy_getvar(struct brcms_phy *pi, const char *name)
int phy_getintvar(struct brcms_phy *pi, const char *name) int phy_getintvar(struct brcms_phy *pi, const char *name)
{ {
char *val; char *val;
unsigned long res;
val = PHY_GETVAR(pi, name); val = PHY_GETVAR(pi, name);
if (val == NULL) if (val && !kstrtoul(val, 0, &res))
return 0; return res;
return simple_strtoul(val, NULL, 0); return 0;
} }
void wlc_phyreg_enter(struct brcms_phy_pub *pih) void wlc_phyreg_enter(struct brcms_phy_pub *pih)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment