Commit 67f72bef authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brmc80211: cleaned up sdio related error codes

Code cleanup. Replaced Broadcom proprietary error codes with Linux native
ones.
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0c51cca8
...@@ -19,10 +19,6 @@ ...@@ -19,10 +19,6 @@
#include "sdio_host.h" #include "sdio_host.h"
#define SDIOH_API_RC_SUCCESS (0x00)
#define SDIOH_API_RC_FAIL (0x01)
#define SDIOH_API_SUCCESS(status) (status == 0)
#define SDIOH_READ 0 /* Read request */ #define SDIOH_READ 0 /* Read request */
#define SDIOH_WRITE 1 /* Write request */ #define SDIOH_WRITE 1 /* Write request */
......
...@@ -105,7 +105,7 @@ bool brcmf_sdcard_intr_query(void *sdh) ...@@ -105,7 +105,7 @@ bool brcmf_sdcard_intr_query(void *sdh)
ASSERT(bcmsdh); ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_query(bcmsdh->sdioh, &on); status = brcmf_sdioh_interrupt_query(bcmsdh->sdioh, &on);
if (SDIOH_API_SUCCESS(status)) if (status == 0)
return false; return false;
else else
return on; return on;
...@@ -114,41 +114,33 @@ bool brcmf_sdcard_intr_query(void *sdh) ...@@ -114,41 +114,33 @@ bool brcmf_sdcard_intr_query(void *sdh)
int brcmf_sdcard_intr_enable(void *sdh) int brcmf_sdcard_intr_enable(void *sdh)
{ {
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh; struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
int status;
ASSERT(bcmsdh); ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true); return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
} }
int brcmf_sdcard_intr_disable(void *sdh) int brcmf_sdcard_intr_disable(void *sdh)
{ {
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh; struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
int status;
ASSERT(bcmsdh); ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false); return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
} }
int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh) int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{ {
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh; struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
int status;
ASSERT(bcmsdh); ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh); return brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
} }
int brcmf_sdcard_intr_dereg(void *sdh) int brcmf_sdcard_intr_dereg(void *sdh)
{ {
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh; struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
int status;
ASSERT(bcmsdh); ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh); return brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
} }
#if defined(BCMDBG) #if defined(BCMDBG)
...@@ -192,11 +184,11 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err) ...@@ -192,11 +184,11 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
brcmf_sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr, brcmf_sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data); (u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (!SDIOH_API_SUCCESS(status) } while (status != 0
&& (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT)); && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
#endif #endif
if (err) if (err)
*err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO); *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n", BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
__func__, fnc_num, addr, data)); __func__, fnc_num, addr, data));
...@@ -227,11 +219,11 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err) ...@@ -227,11 +219,11 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
brcmf_sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr, brcmf_sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data); (u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (!SDIOH_API_SUCCESS(status) } while (status != 0
&& (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT)); && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
#endif #endif
if (err) if (err)
*err = SDIOH_API_SUCCESS(status) ? 0 : -EIO; *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n", BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
__func__, fnc_num, addr, data)); __func__, fnc_num, addr, data));
...@@ -252,7 +244,7 @@ u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err) ...@@ -252,7 +244,7 @@ u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
SDIOH_READ, fnc_num, addr, &data, 4); SDIOH_READ, fnc_num, addr, &data, 4);
if (err) if (err)
*err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO); *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n", BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
__func__, fnc_num, addr, data)); __func__, fnc_num, addr, data));
...@@ -277,7 +269,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data, ...@@ -277,7 +269,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
SDIOH_WRITE, fnc_num, addr, &data, 4); SDIOH_WRITE, fnc_num, addr, &data, 4);
if (err) if (err)
*err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO); *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n", BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
__func__, fnc_num, addr, data)); __func__, fnc_num, addr, data));
...@@ -320,7 +312,7 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length) ...@@ -320,7 +312,7 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
kfree(tmp_buf); kfree(tmp_buf);
} }
return SDIOH_API_SUCCESS(status) ? 0 : -EIO; return status;
} }
static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address) static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
...@@ -371,12 +363,12 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size) ...@@ -371,12 +363,12 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL, status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, SDIO_FUNC_1, addr, &word, size); SDIOH_READ, SDIO_FUNC_1, addr, &word, size);
bcmsdh->regfail = !(SDIOH_API_SUCCESS(status)); bcmsdh->regfail = (status != 0);
BCMSDH_INFO(("u32data = 0x%x\n", word)); BCMSDH_INFO(("u32data = 0x%x\n", word));
/* if ok, return appropriately masked word */ /* if ok, return appropriately masked word */
if (SDIOH_API_SUCCESS(status)) { if (status == 0) {
switch (size) { switch (size) {
case sizeof(u8): case sizeof(u8):
return word & 0xff; return word & 0xff;
...@@ -425,9 +417,9 @@ u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data) ...@@ -425,9 +417,9 @@ u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
status = status =
brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL, brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, SDIO_FUNC_1, addr, &data, size); SDIOH_WRITE, SDIO_FUNC_1, addr, &data, size);
bcmsdh->regfail = !(SDIOH_API_SUCCESS(status)); bcmsdh->regfail = (status != 0);
if (SDIOH_API_SUCCESS(status)) if (status == 0)
return 0; return 0;
BCMSDH_ERROR(("%s: error writing 0x%08x to addr 0x%04x size %d\n", BCMSDH_ERROR(("%s: error writing 0x%08x to addr 0x%04x size %d\n",
...@@ -480,7 +472,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags, ...@@ -480,7 +472,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_READ, fn, addr, width, nbytes, buf, pkt); incr_fix, SDIOH_READ, fn, addr, width, nbytes, buf, pkt);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO; return status;
} }
int int
...@@ -489,7 +481,6 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags, ...@@ -489,7 +481,6 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
bcmsdh_cmplt_fn_t complete, void *handle) bcmsdh_cmplt_fn_t complete, void *handle)
{ {
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh; struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
int status;
uint incr_fix; uint incr_fix;
uint width; uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK; uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
...@@ -521,16 +512,13 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags, ...@@ -521,16 +512,13 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
if (width == 4) if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt); incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
} }
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes) int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{ {
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh; struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
int status;
ASSERT(bcmsdh); ASSERT(bcmsdh);
ASSERT(bcmsdh->init_success); ASSERT(bcmsdh->init_success);
...@@ -539,11 +527,9 @@ int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes) ...@@ -539,11 +527,9 @@ int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
addr &= SBSDIO_SB_OFT_ADDR_MASK; addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
SDIOH_DATA_INC, (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1, SDIOH_DATA_INC, (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
addr, 4, nbytes, buf, NULL); addr, 4, nbytes, buf, NULL);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
} }
int brcmf_sdcard_abort(void *sdh, uint fn) int brcmf_sdcard_abort(void *sdh, uint fn)
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h> #include <linux/mmc/sdio_ids.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/errno.h>
#include <defs.h> #include <defs.h>
#include <brcm_hw_ids.h> #include <brcm_hw_ids.h>
...@@ -174,7 +175,7 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd) ...@@ -174,7 +175,7 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd)
kfree(sd); kfree(sd);
} }
return SDIOH_API_RC_SUCCESS; return 0;
} }
/* Configure callback to client when we receive client interrupt */ /* Configure callback to client when we receive client interrupt */
...@@ -186,7 +187,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn, ...@@ -186,7 +187,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
if (fn == NULL) { if (fn == NULL) {
sd_err(("%s: interrupt handler is NULL, not registering\n", sd_err(("%s: interrupt handler is NULL, not registering\n",
__func__)); __func__));
return SDIOH_API_RC_FAIL; return -EINVAL;
} }
sd->intr_handler = fn; sd->intr_handler = fn;
...@@ -206,7 +207,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn, ...@@ -206,7 +207,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
sdio_release_host(gInstance->func[1]); sdio_release_host(gInstance->func[1]);
} }
return SDIOH_API_RC_SUCCESS; return 0;
} }
extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd) extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
...@@ -232,7 +233,7 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd) ...@@ -232,7 +233,7 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
sd->intr_handler = NULL; sd->intr_handler = NULL;
sd->intr_handler_arg = NULL; sd->intr_handler_arg = NULL;
return SDIOH_API_RC_SUCCESS; return 0;
} }
extern int extern int
...@@ -240,7 +241,7 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff) ...@@ -240,7 +241,7 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
{ {
sd_trace(("%s: Entering\n", __func__)); sd_trace(("%s: Entering\n", __func__));
*onoff = sd->client_intr_enabled; *onoff = sd->client_intr_enabled;
return SDIOH_API_RC_SUCCESS; return 0;
} }
#if defined(BCMDBG) #if defined(BCMDBG)
...@@ -501,7 +502,7 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length) ...@@ -501,7 +502,7 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
if (!sd->func_cis_ptr[func]) { if (!sd->func_cis_ptr[func]) {
memset(cis, 0, length); memset(cis, 0, length);
sd_err(("%s: no func_cis_ptr[%d]\n", __func__, func)); sd_err(("%s: no func_cis_ptr[%d]\n", __func__, func));
return SDIOH_API_RC_FAIL; return -ENOTSUPP;
} }
sd_err(("%s: func_cis_ptr[%d]=0x%04x\n", __func__, func, sd_err(("%s: func_cis_ptr[%d]=0x%04x\n", __func__, func,
...@@ -512,14 +513,14 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length) ...@@ -512,14 +513,14 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
if (brcmf_sdioh_card_regread(sd, 0, offset, 1, &foo) < 0) { if (brcmf_sdioh_card_regread(sd, 0, offset, 1, &foo) < 0) {
sd_err(("%s: regread failed: Can't read CIS\n", sd_err(("%s: regread failed: Can't read CIS\n",
__func__)); __func__));
return SDIOH_API_RC_FAIL; return -EIO;
} }
*cis = (u8) (foo & 0xff); *cis = (u8) (foo & 0xff);
cis++; cis++;
} }
return SDIOH_API_RC_SUCCESS; return 0;
} }
extern int extern int
...@@ -532,7 +533,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, ...@@ -532,7 +533,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
regaddr)); regaddr));
BRCMF_PM_RESUME_WAIT(sdioh_request_byte_wait); BRCMF_PM_RESUME_WAIT(sdioh_request_byte_wait);
BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL); BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
if (rw) { /* CMD52 Write */ if (rw) { /* CMD52 Write */
if (func == 0) { if (func == 0) {
/* Can only directly write to some F0 registers. /* Can only directly write to some F0 registers.
...@@ -616,25 +617,25 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, ...@@ -616,25 +617,25 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
"Err: %d\n", rw ? "Write" : "Read", func, regaddr, "Err: %d\n", rw ? "Write" : "Read", func, regaddr,
*byte, err_ret)); *byte, err_ret));
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL); return err_ret;
} }
extern int extern int
brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw, brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
uint func, uint addr, u32 *word, uint nbytes) uint func, uint addr, u32 *word, uint nbytes)
{ {
int err_ret = SDIOH_API_RC_FAIL; int err_ret = -EIO;
if (func == 0) { if (func == 0) {
sd_err(("%s: Only CMD52 allowed to F0.\n", __func__)); sd_err(("%s: Only CMD52 allowed to F0.\n", __func__));
return SDIOH_API_RC_FAIL; return -EINVAL;
} }
sd_info(("%s: cmd_type=%d, rw=%d, func=%d, addr=0x%05x, nbytes=%d\n", sd_info(("%s: cmd_type=%d, rw=%d, func=%d, addr=0x%05x, nbytes=%d\n",
__func__, cmd_type, rw, func, addr, nbytes)); __func__, cmd_type, rw, func, addr, nbytes));
BRCMF_PM_RESUME_WAIT(sdioh_request_word_wait); BRCMF_PM_RESUME_WAIT(sdioh_request_word_wait);
BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL); BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
/* Claim host controller */ /* Claim host controller */
sdio_claim_host(gInstance->func[func]); sdio_claim_host(gInstance->func[func]);
...@@ -669,7 +670,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw, ...@@ -669,7 +670,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
rw ? "Write" : "Read", err_ret)); rw ? "Write" : "Read", err_ret));
} }
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL); return err_ret;
} }
static int static int
...@@ -686,7 +687,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write, ...@@ -686,7 +687,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
ASSERT(pkt); ASSERT(pkt);
BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait); BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait);
BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL); BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
/* Claim host controller */ /* Claim host controller */
sdio_claim_host(gInstance->func[func]); sdio_claim_host(gInstance->func[func]);
...@@ -743,7 +744,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write, ...@@ -743,7 +744,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
sdio_release_host(gInstance->func[func]); sdio_release_host(gInstance->func[func]);
sd_trace(("%s: Exit\n", __func__)); sd_trace(("%s: Exit\n", __func__));
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL); return err_ret;
} }
/* /*
...@@ -772,7 +773,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc, ...@@ -772,7 +773,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
sd_trace(("%s: Enter\n", __func__)); sd_trace(("%s: Enter\n", __func__));
BRCMF_PM_RESUME_WAIT(sdioh_request_buffer_wait); BRCMF_PM_RESUME_WAIT(sdioh_request_buffer_wait);
BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL); BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
/* Case 1: we don't have a packet. */ /* Case 1: we don't have a packet. */
if (pkt == NULL) { if (pkt == NULL) {
sd_data(("%s: Creating new %s Packet, len=%d\n", sd_data(("%s: Creating new %s Packet, len=%d\n",
...@@ -781,7 +782,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc, ...@@ -781,7 +782,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
if (!mypkt) { if (!mypkt) {
sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n", sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n",
__func__, buflen_u)); __func__, buflen_u));
return SDIOH_API_RC_FAIL; return -EIO;
} }
/* For a write, copy the buffer data into the packet. */ /* For a write, copy the buffer data into the packet. */
...@@ -808,7 +809,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc, ...@@ -808,7 +809,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
if (!mypkt) { if (!mypkt) {
sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n", sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n",
__func__, pkt->len)); __func__, pkt->len));
return SDIOH_API_RC_FAIL; return -EIO;
} }
/* For a write, copy the buffer data into the packet. */ /* For a write, copy the buffer data into the packet. */
...@@ -845,7 +846,7 @@ extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func) ...@@ -845,7 +846,7 @@ extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
&t_func); &t_func);
sd_trace(("%s: Exit\n", __func__)); sd_trace(("%s: Exit\n", __func__));
return SDIOH_API_RC_SUCCESS; return 0;
} }
/* Reset and re-initialize the device */ /* Reset and re-initialize the device */
...@@ -853,7 +854,7 @@ int brcmf_sdioh_reset(struct sdioh_info *si) ...@@ -853,7 +854,7 @@ int brcmf_sdioh_reset(struct sdioh_info *si)
{ {
sd_trace(("%s: Enter\n", __func__)); sd_trace(("%s: Enter\n", __func__));
sd_trace(("%s: Exit\n", __func__)); sd_trace(("%s: Exit\n", __func__));
return SDIOH_API_RC_SUCCESS; return 0;
} }
/* Disable device interrupt */ /* Disable device interrupt */
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/mmc/card.h> #include <linux/mmc/card.h>
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h> #include <linux/mmc/sdio_ids.h>
#include <linux/errno.h>
#include <net/cfg80211.h> #include <net/cfg80211.h>
#include <defs.h> #include <defs.h>
...@@ -219,7 +220,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable) ...@@ -219,7 +220,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
if (enable && !(sd->intr_handler && sd->intr_handler_arg)) { if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
sd_err(("%s: no handler registered, will not enable\n", sd_err(("%s: no handler registered, will not enable\n",
__func__)); __func__));
return SDIOH_API_RC_FAIL; return -EINVAL;
} }
/* Ensure atomicity for enable/disable calls */ /* Ensure atomicity for enable/disable calls */
...@@ -233,7 +234,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable) ...@@ -233,7 +234,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
spin_unlock_irqrestore(&sdos->lock, flags); spin_unlock_irqrestore(&sdos->lock, flags);
return SDIOH_API_RC_SUCCESS; return 0;
} }
/* /*
......
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