Skip to content

Commit

Permalink
staging: brcm80211: made fullmac error codes more consistent
Browse files Browse the repository at this point in the history
Code cleanup. The code contains several checks on the condition
SDIOH_API_SUCCESS(status). On failure, the error returned depended on the
check, instead of being consistent. This has been corrected.

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>
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed May 3, 2011
1 parent b74ac12 commit 1bc93ce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/staging/brcm80211/brcmfmac/bcmsdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int bcmsdh_intr_enable(void *sdh)
ASSERT(bcmsdh);

status = sdioh_interrupt_set(bcmsdh->sdioh, true);
return SDIOH_API_SUCCESS(status) ? 0 : -EBADE;
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}

int bcmsdh_intr_disable(void *sdh)
Expand All @@ -136,7 +136,7 @@ int bcmsdh_intr_disable(void *sdh)
ASSERT(bcmsdh);

status = sdioh_interrupt_set(bcmsdh->sdioh, false);
return SDIOH_API_SUCCESS(status) ? 0 : -EBADE;
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}

int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
Expand All @@ -146,7 +146,7 @@ int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
ASSERT(bcmsdh);

status = sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
return SDIOH_API_SUCCESS(status) ? 0 : -EBADE;
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}

int bcmsdh_intr_dereg(void *sdh)
Expand All @@ -156,7 +156,7 @@ int bcmsdh_intr_dereg(void *sdh)
ASSERT(bcmsdh);

status = sdioh_interrupt_deregister(bcmsdh->sdioh);
return SDIOH_API_SUCCESS(status) ? 0 : -EBADE;
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}

#if defined(DHD_DEBUG)
Expand Down Expand Up @@ -329,7 +329,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
kfree(tmp_buf);
}

return SDIOH_API_SUCCESS(status) ? 0 : -EBADE;
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}

static int bcmsdhsdio_set_sbaddr_window(void *sdh, u32 address)
Expand Down Expand Up @@ -533,7 +533,7 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
SDIOH_WRITE, fn, addr, width, nbytes, buf,
pkt);

return SDIOH_API_SUCCESS(status) ? 0 : -EBADE;
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}

int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
Expand All @@ -553,7 +553,7 @@ int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
(rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
addr, 4, nbytes, buf, NULL);

return SDIOH_API_SUCCESS(status) ? 0 : -EBADE;
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}

int bcmsdh_abort(void *sdh, uint fn)
Expand Down

0 comments on commit 1bc93ce

Please sign in to comment.