static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data)
{
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
+ int ret;
data = cpu_to_le32(data);
cmd.count = 4;
cmd.buffer = (u8 *)&data;
cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */
-
- if (!wilc_sdio_cmd53(wilc, &cmd)) {
+ ret = wilc_sdio_cmd53(wilc, &cmd);
+ if (ret) {
dev_err(&func->dev,
"Failed cmd53, write reg (%08x)...\n", addr);
goto _fail_;
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
u32 block_size = g_sdio.block_size;
sdio_cmd53_t cmd;
- int nblk, nleft;
+ int nblk, nleft, ret;
cmd.read_write = 1;
if (addr > 0) {
if (!sdio_set_func0_csa_address(wilc, addr))
goto _fail_;
}
- if (!wilc_sdio_cmd53(wilc, &cmd)) {
+ ret = wilc_sdio_cmd53(wilc, &cmd);
+ if (ret) {
dev_err(&func->dev,
"Failed cmd53 [%x], block send...\n", addr);
goto _fail_;
if (!sdio_set_func0_csa_address(wilc, addr))
goto _fail_;
}
- if (!wilc_sdio_cmd53(wilc, &cmd)) {
+ ret = wilc_sdio_cmd53(wilc, &cmd);
+ if (ret) {
dev_err(&func->dev,
"Failed cmd53 [%x], bytes send...\n", addr);
goto _fail_;
static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data)
{
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
+ int ret;
if ((addr >= 0xf0) && (addr <= 0xff)) {
sdio_cmd52_t cmd;
cmd.buffer = (u8 *)data;
cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */
-
- if (!wilc_sdio_cmd53(wilc, &cmd)) {
+ ret = wilc_sdio_cmd53(wilc, &cmd);
+ if (ret) {
dev_err(&func->dev,
"Failed cmd53, read reg (%08x)...\n", addr);
goto _fail_;
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
u32 block_size = g_sdio.block_size;
sdio_cmd53_t cmd;
- int nblk, nleft;
+ int nblk, nleft, ret;
cmd.read_write = 0;
if (addr > 0) {
if (!sdio_set_func0_csa_address(wilc, addr))
goto _fail_;
}
- if (!wilc_sdio_cmd53(wilc, &cmd)) {
+ ret = wilc_sdio_cmd53(wilc, &cmd);
+ if (ret) {
dev_err(&func->dev,
"Failed cmd53 [%x], block read...\n", addr);
goto _fail_;
if (!sdio_set_func0_csa_address(wilc, addr))
goto _fail_;
}
- if (!wilc_sdio_cmd53(wilc, &cmd)) {
+ ret = wilc_sdio_cmd53(wilc, &cmd);
+ if (ret) {
dev_err(&func->dev,
"Failed cmd53 [%x], bytes read...\n", addr);
goto _fail_;