Commit f7b94ae6 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: fix too many leading tabs warning in sdio_clear_int_ext()

Refactor sdio_clear_int_ext() function to remove "Too many leading tabs"
warning reported by checkpatch.pl script.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c1e5ec5
...@@ -871,6 +871,7 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val) ...@@ -871,6 +871,7 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val)
{ {
struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct sdio_func *func = dev_to_sdio_func(wilc->dev);
int ret; int ret;
int vmm_ctl;
if (g_sdio.has_thrpt_enh3) { if (g_sdio.has_thrpt_enh3) {
u32 reg; u32 reg;
...@@ -909,84 +910,79 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val) ...@@ -909,84 +910,79 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val)
goto _fail_; goto _fail_;
} }
} }
} else { return 1;
if (g_sdio.irq_gpio) { }
/* see below. has_thrpt_enh2 uses register 0xf8 to clear interrupts. */ if (g_sdio.irq_gpio) {
/* Cannot clear multiple interrupts. Must clear each interrupt individually */ /* see below. has_thrpt_enh2 uses register 0xf8 to clear interrupts. */
u32 flags; /* Cannot clear multiple interrupts. Must clear each interrupt individually */
u32 flags;
flags = val & (BIT(MAX_NUM_INT) - 1);
if (flags) { flags = val & (BIT(MAX_NUM_INT) - 1);
int i; if (flags) {
int i;
ret = 1;
for (i = 0; i < g_sdio.nint; i++) { ret = 1;
if (flags & 1) { for (i = 0; i < g_sdio.nint; i++) {
struct sdio_cmd52 cmd; if (flags & 1) {
struct sdio_cmd52 cmd;
cmd.read_write = 1;
cmd.function = 0; cmd.read_write = 1;
cmd.raw = 0; cmd.function = 0;
cmd.address = 0xf8; cmd.raw = 0;
cmd.data = BIT(i); cmd.address = 0xf8;
cmd.data = BIT(i);
ret = wilc_sdio_cmd52(wilc, &cmd);
if (ret) { ret = wilc_sdio_cmd52(wilc, &cmd);
dev_err(&func->dev, if (ret) {
"Failed cmd52, set 0xf8 data (%d) ...\n", dev_err(&func->dev,
__LINE__); "Failed cmd52, set 0xf8 data (%d) ...\n",
goto _fail_; __LINE__);
} goto _fail_;
} }
if (!ret)
break;
flags >>= 1;
} }
if (!ret) if (!ret)
goto _fail_; break;
for (i = g_sdio.nint; i < MAX_NUM_INT; i++) { flags >>= 1;
if (flags & 1)
dev_err(&func->dev,
"Unexpected interrupt cleared %d...\n",
i);
flags >>= 1;
}
} }
} if (!ret)
goto _fail_;
{ for (i = g_sdio.nint; i < MAX_NUM_INT; i++) {
u32 vmm_ctl; if (flags & 1)
vmm_ctl = 0;
/* select VMM table 0 */
if ((val & SEL_VMM_TBL0) == SEL_VMM_TBL0)
vmm_ctl |= BIT(0);
/* select VMM table 1 */
if ((val & SEL_VMM_TBL1) == SEL_VMM_TBL1)
vmm_ctl |= BIT(1);
/* enable VMM */
if ((val & EN_VMM) == EN_VMM)
vmm_ctl |= BIT(2);
if (vmm_ctl) {
struct sdio_cmd52 cmd;
cmd.read_write = 1;
cmd.function = 0;
cmd.raw = 0;
cmd.address = 0xf6;
cmd.data = vmm_ctl;
ret = wilc_sdio_cmd52(wilc, &cmd);
if (ret) {
dev_err(&func->dev, dev_err(&func->dev,
"Failed cmd52, set 0xf6 data (%d) ...\n", "Unexpected interrupt cleared %d...\n",
__LINE__); i);
goto _fail_; flags >>= 1;
}
} }
} }
} }
vmm_ctl = 0;
/* select VMM table 0 */
if ((val & SEL_VMM_TBL0) == SEL_VMM_TBL0)
vmm_ctl |= BIT(0);
/* select VMM table 1 */
if ((val & SEL_VMM_TBL1) == SEL_VMM_TBL1)
vmm_ctl |= BIT(1);
/* enable VMM */
if ((val & EN_VMM) == EN_VMM)
vmm_ctl |= BIT(2);
if (vmm_ctl) {
struct sdio_cmd52 cmd;
cmd.read_write = 1;
cmd.function = 0;
cmd.raw = 0;
cmd.address = 0xf6;
cmd.data = vmm_ctl;
ret = wilc_sdio_cmd52(wilc, &cmd);
if (ret) {
dev_err(&func->dev,
"Failed cmd52, set 0xf6 data (%d) ...\n",
__LINE__);
goto _fail_;
}
}
return 1; return 1;
_fail_: _fail_:
return 0; 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