diff mbox

[RFC/RFT,6/7] gpio: omap: clean up omap_gpio_irq_type

Message ID 1432305354-5968-7-git-send-email-grygorii.strashko@linaro.org
State New
Headers show

Commit Message

grygorii.strashko@linaro.org May 22, 2015, 2:35 p.m. UTC
The omap_gpio_irq_type() can do only configuration of GPIO IRQ
triggering type, because now OMAP GPIO driver has implemented
.irq_startup()/.irq_shutdown() which are responsible for
GPIO bank enabling and pin direction configuration.

Hence, remove redundant code and omap_gpio_init_irq() which is
not used any more.

Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

Tony Lindgren May 22, 2015, 5:53 p.m. UTC | #1
Hi,

* Grygorii Strashko <grygorii.strashko@linaro.org> [150522 07:37]:
> The omap_gpio_irq_type() can do only configuration of GPIO IRQ
> triggering type, because now OMAP GPIO driver has implemented
> .irq_startup()/.irq_shutdown() which are responsible for
> GPIO bank enabling and pin direction configuration.
> 
> Hence, remove redundant code and omap_gpio_init_irq() which is
> not used any more.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
> ---
>  drivers/gpio/gpio-omap.c | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 1c226f1..f02b3fa 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -472,15 +472,6 @@ static int omap_gpio_is_input(struct gpio_bank *bank, unsigned offset)
>  	return readl_relaxed(reg) & BIT(offset);
>  }
>  
> -static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned offset)
> -{
> -	if (!LINE_USED(bank->mod_usage, offset)) {
> -		omap_enable_gpio_module(bank, offset);
> -		omap_set_gpio_direction(bank, offset, 1);
> -	}
> -	bank->irq_usage |= BIT(offset);
> -}
> -
>  static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
>  {
>  	struct gpio_bank *bank = omap_irq_data_get_bank(d);
> @@ -502,12 +493,6 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
>  	retval = omap_set_gpio_triggering(bank, offset, type);
>  	if (retval)
>  		goto error;
> -	omap_gpio_init_irq(bank, offset);
> -	if (!omap_gpio_is_input(bank, offset)) {
> -		spin_unlock_irqrestore(&bank->lock, flags);
> -		retval = -EINVAL;
> -		goto error;
> -	}
>  	spin_unlock_irqrestore(&bank->lock, flags);
>  
>  	if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))

This one seems to break smsc911x GPIO interrupt somehow and
nfsroot becomes very slow and system becomes unresponsive.
The Ethernet conroller probably runs mostly in polling mode
or something with this patch.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 1c226f1..f02b3fa 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -472,15 +472,6 @@  static int omap_gpio_is_input(struct gpio_bank *bank, unsigned offset)
 	return readl_relaxed(reg) & BIT(offset);
 }
 
-static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned offset)
-{
-	if (!LINE_USED(bank->mod_usage, offset)) {
-		omap_enable_gpio_module(bank, offset);
-		omap_set_gpio_direction(bank, offset, 1);
-	}
-	bank->irq_usage |= BIT(offset);
-}
-
 static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
@@ -502,12 +493,6 @@  static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 	retval = omap_set_gpio_triggering(bank, offset, type);
 	if (retval)
 		goto error;
-	omap_gpio_init_irq(bank, offset);
-	if (!omap_gpio_is_input(bank, offset)) {
-		spin_unlock_irqrestore(&bank->lock, flags);
-		retval = -EINVAL;
-		goto error;
-	}
 	spin_unlock_irqrestore(&bank->lock, flags);
 
 	if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))