linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: mvebu: only fail on missing clk if pwm is actually to be used
@ 2018-12-17  8:43 Uwe Kleine-König
  2018-12-17  8:46 ` Gregory CLEMENT
  2018-12-17 14:25 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2018-12-17  8:43 UTC (permalink / raw)
  To: Linus Walleij, Andrew Lunn, Ralph Sennhauser
  Cc: linux-gpio, stable, Thierry Reding, linux-arm-kernel, kernel

The gpio IP on Armada 370 at offset 0x18180 has neither a clk nor pwm
registers. So there is no need for a clk as the pwm isn't used anyhow.
So only check for the clk in the presence of the pwm registers. This fixes
a failure to probe the gpio driver for the above mentioned gpio device.

Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpio/gpio-mvebu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 6e02148c208b..adc768f908f1 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -773,9 +773,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
 				     "marvell,armada-370-gpio"))
 		return 0;
 
-	if (IS_ERR(mvchip->clk))
-		return PTR_ERR(mvchip->clk);
-
 	/*
 	 * There are only two sets of PWM configuration registers for
 	 * all the GPIO lines on those SoCs which this driver reserves
@@ -786,6 +783,9 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
 	if (!res)
 		return 0;
 
+	if (IS_ERR(mvchip->clk))
+		return PTR_ERR(mvchip->clk);
+
 	/*
 	 * Use set A for lines of GPIO chip with id 0, B for GPIO chip
 	 * with id 1. Don't allow further GPIO chips to be used for PWM.
-- 
2.19.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: mvebu: only fail on missing clk if pwm is actually to be used
  2018-12-17  8:43 [PATCH] gpio: mvebu: only fail on missing clk if pwm is actually to be used Uwe Kleine-König
@ 2018-12-17  8:46 ` Gregory CLEMENT
  2018-12-17 14:25 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Gregory CLEMENT @ 2018-12-17  8:46 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andrew Lunn, Linus Walleij, stable, linux-gpio, Thierry Reding,
	kernel, Ralph Sennhauser, linux-arm-kernel

Hi,
 
 On lun., déc. 17 2018, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> The gpio IP on Armada 370 at offset 0x18180 has neither a clk nor pwm
> registers. So there is no need for a clk as the pwm isn't used anyhow.
> So only check for the clk in the presence of the pwm registers. This fixes
> a failure to probe the gpio driver for the above mentioned gpio device.
>
> Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>

Thanks,

Gregory


> ---
>  drivers/gpio/gpio-mvebu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
> index 6e02148c208b..adc768f908f1 100644
> --- a/drivers/gpio/gpio-mvebu.c
> +++ b/drivers/gpio/gpio-mvebu.c
> @@ -773,9 +773,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
>  				     "marvell,armada-370-gpio"))
>  		return 0;
>  
> -	if (IS_ERR(mvchip->clk))
> -		return PTR_ERR(mvchip->clk);
> -
>  	/*
>  	 * There are only two sets of PWM configuration registers for
>  	 * all the GPIO lines on those SoCs which this driver reserves
> @@ -786,6 +783,9 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
>  	if (!res)
>  		return 0;
>  
> +	if (IS_ERR(mvchip->clk))
> +		return PTR_ERR(mvchip->clk);
> +
>  	/*
>  	 * Use set A for lines of GPIO chip with id 0, B for GPIO chip
>  	 * with id 1. Don't allow further GPIO chips to be used for PWM.
> -- 
> 2.19.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: mvebu: only fail on missing clk if pwm is actually to be used
  2018-12-17  8:43 [PATCH] gpio: mvebu: only fail on missing clk if pwm is actually to be used Uwe Kleine-König
  2018-12-17  8:46 ` Gregory CLEMENT
@ 2018-12-17 14:25 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2018-12-17 14:25 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andrew Lunn, stable, open list:GPIO SUBSYSTEM, Thierry Reding,
	Sascha Hauer, Ralph Sennhauser, Linux ARM

On Mon, Dec 17, 2018 at 9:43 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> The gpio IP on Armada 370 at offset 0x18180 has neither a clk nor pwm
> registers. So there is no need for a clk as the pwm isn't used anyhow.
> So only check for the clk in the presence of the pwm registers. This fixes
> a failure to probe the gpio driver for the above mentioned gpio device.
>
> Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Patch applied for fixes with Gregory's review tag!

Will try to get this upstream with some other GPIO
fixes ASAP.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-17 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-17  8:43 [PATCH] gpio: mvebu: only fail on missing clk if pwm is actually to be used Uwe Kleine-König
2018-12-17  8:46 ` Gregory CLEMENT
2018-12-17 14:25 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).