Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1653174

[PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is used

From Richard Genoud <richard.genoud@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is used
Date 2017-05-30 14:30 +0200
Message-ID <tMOrD-7i1-1@gated-at.bofh.it> (permalink)
References <tMOrD-7i1-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


If more than one gpio bank has the "pwm" property, only one will be
registered successfully, all the others will fail with:
mvebu-gpio: probe of f1018140.gpio failed with error -17

That's because in alloc_pwms(), the chip->base (aka "int pwm"), was not
set (thus, ==0) ; and 0 is a meaningful start value in alloc_pwm().
What was intended is chip->base = -1.
Like that, the numbering will be done auto-magically

Tested on clearfog-pro (Marvell 88F6828)

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
 drivers/gpio/gpio-mvebu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index cdef2c78cb3b..4734923e11fd 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -768,6 +768,7 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
 	mvpwm->chip.dev = dev;
 	mvpwm->chip.ops = &mvebu_pwm_ops;
 	mvpwm->chip.npwm = mvchip->chip.ngpio;
+	mvpwm->chip.base = -1;
 
 	spin_lock_init(&mvpwm->lock);
 

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is used Richard Genoud <richard.genoud@gmail.com> - 2017-05-30 14:30 +0200
  Re: [PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is used Gregory CLEMENT <gregory.clement@free-electrons.com> - 2017-05-30 15:20 +0200
    Re: [PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is used Richard Genoud <richard.genoud@gmail.com> - 2017-05-30 16:50 +0200
      Re: [PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is  used Ralph Sennhauser <ralph.sennhauser@gmail.com> - 2017-05-30 17:20 +0200
        Re: [PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is used Richard Genoud <richard.genoud@gmail.com> - 2017-05-30 18:40 +0200

csiph-web