staging: brcm80211: remove flash related code from initvars_srom_pci()
The function initvars_srom_pci() has fallback to obtain drivers settings from flash when no srom device is present. However, this driver does not support flash so the fallback code can be removed. Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
579c83f505
commit
fb10e59111
1 changed files with 21 additions and 52 deletions
|
@ -1212,14 +1212,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
|
||||||
u32 sr;
|
u32 sr;
|
||||||
varbuf_t b;
|
varbuf_t b;
|
||||||
char *vp, *base = NULL;
|
char *vp, *base = NULL;
|
||||||
bool flash = false;
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Apply CRC over SROM content regardless SROM is present or not,
|
* Apply CRC over SROM content regardless SROM is present or not.
|
||||||
* and use variable <devpath>sromrev's existence in flash to decide
|
|
||||||
* if we should return an error when CRC fails or read SROM variables
|
|
||||||
* from flash.
|
|
||||||
*/
|
*/
|
||||||
srom = kmalloc(SROM_MAX, GFP_ATOMIC);
|
srom = kmalloc(SROM_MAX, GFP_ATOMIC);
|
||||||
if (!srom)
|
if (!srom)
|
||||||
|
@ -1265,61 +1261,34 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
|
||||||
err = 1;
|
err = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
if (!err) {
|
||||||
* We want internal/wltest driver to come up with default
|
/* Bitmask for the sromrev */
|
||||||
* sromvars so we can program a blank SPROM/OTP.
|
sr = 1 << sromrev;
|
||||||
*/
|
|
||||||
if (err) {
|
|
||||||
char *value;
|
|
||||||
u32 val;
|
|
||||||
val = 0;
|
|
||||||
|
|
||||||
value = ai_getdevpathvar(sih, "sromrev");
|
/* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
|
||||||
if (value) {
|
if ((sr & 0x33e) == 0) {
|
||||||
sromrev = (u8) simple_strtoul(value, NULL, 0);
|
err = -2;
|
||||||
flash = true;
|
|
||||||
goto varscont;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = ai_getnvramflvar(sih, "sromrev");
|
|
||||||
if (value) {
|
|
||||||
err = 0;
|
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
|
||||||
err = -1;
|
if (!base) {
|
||||||
|
err = -2;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
|
||||||
|
|
||||||
|
/* parse SROM into name=value pairs. */
|
||||||
|
_initvars_srom_pci(sromrev, srom, 0, &b);
|
||||||
|
|
||||||
|
/* final nullbyte terminator */
|
||||||
|
vp = b.buf;
|
||||||
|
*vp++ = '\0';
|
||||||
|
|
||||||
|
err = initvars_table(base, vp, vars, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
varscont:
|
|
||||||
/* Bitmask for the sromrev */
|
|
||||||
sr = 1 << sromrev;
|
|
||||||
|
|
||||||
/* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
|
|
||||||
if ((sr & 0x33e) == 0) {
|
|
||||||
err = -2;
|
|
||||||
goto errout;
|
|
||||||
}
|
|
||||||
|
|
||||||
base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
|
|
||||||
if (!base) {
|
|
||||||
err = -2;
|
|
||||||
goto errout;
|
|
||||||
}
|
|
||||||
|
|
||||||
varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
|
|
||||||
|
|
||||||
/* parse SROM into name=value pairs. */
|
|
||||||
_initvars_srom_pci(sromrev, srom, 0, &b);
|
|
||||||
|
|
||||||
/* final nullbyte terminator */
|
|
||||||
vp = b.buf;
|
|
||||||
*vp++ = '\0';
|
|
||||||
|
|
||||||
err = initvars_table(base, vp, vars, count);
|
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
if (base)
|
if (base)
|
||||||
kfree(base);
|
kfree(base);
|
||||||
|
|
Loading…
Add table
Reference in a new issue