Skip to content

Commit c8da642

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
gpio: mvebu: only fail on missing clk if pwm is actually to be used
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: 757642f ("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> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent abf221d commit c8da642

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio-mvebu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
773773
"marvell,armada-370-gpio"))
774774
return 0;
775775

776-
if (IS_ERR(mvchip->clk))
777-
return PTR_ERR(mvchip->clk);
778-
779776
/*
780777
* There are only two sets of PWM configuration registers for
781778
* all the GPIO lines on those SoCs which this driver reserves
@@ -786,6 +783,9 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
786783
if (!res)
787784
return 0;
788785

786+
if (IS_ERR(mvchip->clk))
787+
return PTR_ERR(mvchip->clk);
788+
789789
/*
790790
* Use set A for lines of GPIO chip with id 0, B for GPIO chip
791791
* with id 1. Don't allow further GPIO chips to be used for PWM.

0 commit comments

Comments
 (0)