staging: brcm80211: replace error codes part 1
Replacing part of the proprietary error code values with native error
code values.
Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 12379d2..2c25e89 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -819,7 +819,7 @@
if (sleep) {
/* Don't sleep if something is pending */
if (bus->dpc_sched || bus->rxskip || pktq_len(&bus->txq))
- return -BCME_BUSY;
+ return -EBUSY;
/* Disable SDIO interrupts (no longer interested) */
bcmsdh_intr_disable(bus->sdh);
@@ -961,7 +961,7 @@
DHD_ERROR(("%s: couldn't allocate new %d-byte "
"packet\n",
__func__, pkt->len + DHD_SDALIGN));
- ret = -BCME_NOMEM;
+ ret = -ENOMEM;
goto done;
}
@@ -1133,7 +1133,7 @@
dhd_txcomplete(bus->dhd, pkt, false);
pkt_buf_free_skb(pkt);
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
- ret = -BCME_NORESOURCE;
+ ret = -ENOSR;
} else {
ret = 0;
}
@@ -1690,7 +1690,7 @@
memcpy(&pktgen, arg, sizeof(pktgen));
if (pktgen.version != DHD_PKTGEN_VERSION)
- return -BCME_BADARG;
+ return -EINVAL;
oldcnt = bus->pktgen_count;
oldmode = bus->pktgen_mode;
@@ -1851,7 +1851,7 @@
if (mbuffer == NULL) {
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__,
msize));
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto done;
}
}
@@ -1859,7 +1859,7 @@
str = kmalloc(maxstrlen, GFP_ATOMIC);
if (str == NULL) {
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__, maxstrlen));
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto done;
}
@@ -2028,7 +2028,7 @@
c->bufsize = le32_to_cpu(c->log.buf_size);
c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
if (c->buf == NULL)
- return -BCME_NOMEM;
+ return -ENOMEM;
}
idx = le32_to_cpu(c->log.idx);
@@ -2094,7 +2094,7 @@
goto err;
}
if (!len) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
goto err;
}
@@ -2104,7 +2104,7 @@
bus->vars = kmalloc(len, GFP_ATOMIC);
bus->varsz = bus->vars ? len : 0;
if (bus->vars == NULL) {
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto err;
}
@@ -2203,7 +2203,7 @@
case IOV_SVAL(IOV_IDLETIME):
if ((int_val < 0) && (int_val != DHD_IDLE_IMMEDIATE))
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
else
bus->idletime = int_val;
break;
@@ -2249,7 +2249,7 @@
"0x%08x size %d dsize %d\n",
__func__, (set ? "set" : "get"),
address, size, dsize));
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
@@ -2264,7 +2264,7 @@
DHD_ERROR(("%s: ramsize 0x%08x doesn't have %d "
"bytes at 0x%08x\n",
__func__, bus->orig_ramsize, size, address));
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
@@ -2322,7 +2322,7 @@
case IOV_SVAL(IOV_SDRXCHAIN):
if (bool_val && !bus->sd_rxchain)
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
else
bus->use_rxchain = bool_val;
break;
@@ -2345,7 +2345,7 @@
if (bus->varsz < (uint) len)
memcpy(arg, bus->vars, bus->varsz);
else
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
#endif /* DHD_DEBUG */
@@ -2509,7 +2509,7 @@
break;
default:
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
break;
}
@@ -2546,7 +2546,7 @@
if (bus->vars) {
vbuffer = kzalloc(varsize, GFP_ATOMIC);
if (!vbuffer)
- return -BCME_NOMEM;
+ return -ENOMEM;
memcpy(vbuffer, bus->vars, bus->varsz);
@@ -2558,7 +2558,7 @@
DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
nvram_ularray = kmalloc(varsize, GFP_ATOMIC);
if (!nvram_ularray)
- return -BCME_NOMEM;
+ return -ENOMEM;
/* Upload image to verify downloaded contents. */
memset(nvram_ularray, 0xaa, varsize);
@@ -4918,7 +4918,7 @@
/* Address could be zero if CONSOLE := 0 in dongle Makefile */
if (bus->console_addr == 0)
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
/* Exclusive bus access */
dhd_os_sdlock(bus->dhd);
@@ -5145,7 +5145,7 @@
/* if firmware path present try to download and bring up bus */
ret = dhd_bus_start(bus->dhd);
if (ret != 0) {
- if (ret == -BCME_NOTUP) {
+ if (ret == -ENOLINK) {
DHD_ERROR(("%s: dongle is not responding\n", __func__));
goto fail;
}
@@ -5588,7 +5588,7 @@
ularray = kmalloc(bus->ramsize, GFP_ATOMIC);
if (!ularray) {
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto err;
}
/* Upload image to verify downloaded contents. */