Commit 8d4ab8f7 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: factor out irq setup process to ks7010_sdio_setup_irqs

This commit extract sdio irq setup process into a new
function ks7010_sdio_setup_irqs to improve readability.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4f54056
...@@ -802,6 +802,26 @@ static void ks7010_init_defaults(struct ks_wlan_private *priv) ...@@ -802,6 +802,26 @@ static void ks7010_init_defaults(struct ks_wlan_private *priv)
priv->reg.rate_set.size = 12; priv->reg.rate_set.size = 12;
} }
static int ks7010_sdio_setup_irqs(struct sdio_func *func)
{
int ret;
/* interrupt disable */
sdio_writeb(func, 0, INT_ENABLE, &ret);
if (ret)
goto irq_error;
sdio_writeb(func, 0xff, INT_PENDING, &ret);
if (ret)
goto irq_error;
/* setup interrupt handler */
ret = sdio_claim_irq(func, ks_sdio_interrupt);
irq_error:
return ret;
}
static void ks7010_sdio_init_irqs(struct sdio_func *func, static void ks7010_sdio_init_irqs(struct sdio_func *func,
struct ks_wlan_private *priv) struct ks_wlan_private *priv)
{ {
...@@ -855,17 +875,7 @@ static int ks7010_sdio_probe(struct sdio_func *func, ...@@ -855,17 +875,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
if (ret) if (ret)
goto err_free_card; goto err_free_card;
/* interrupt disable */ ret = ks7010_sdio_setup_irqs(func);
sdio_writeb(func, 0, INT_ENABLE, &ret);
if (ret)
goto err_disable_func;
sdio_writeb(func, 0xff, INT_PENDING, &ret);
if (ret)
goto err_disable_func;
/* setup interrupt handler */
ret = sdio_claim_irq(func, ks_sdio_interrupt);
if (ret) if (ret)
goto err_disable_func; goto err_disable_func;
......
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