Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: narmstrong@baylibre.com (Neil Armstrong)
To: linus-amlogic@lists.infradead.org
Subject: [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT
Date: Thu, 23 Mar 2017 17:27:28 +0100	[thread overview]
Message-ID: <1490286449-19448-6-git-send-email-narmstrong@baylibre.com> (raw)
In-Reply-To: <1490286449-19448-1-git-send-email-narmstrong@baylibre.com>

When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
is needed when gpiochip_add_data() is called but in the current implementation
the ranges are added from the driver afterwards.

A simple solution is to rely on the DR gpio-ranges attribute and remove the
call to gpiochip_add_pin_range().

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/pinctrl/meson/pinctrl-meson.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index cf1686e..66ed70c 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -555,22 +555,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
 	if (ret) {
 		dev_err(pc->dev, "can't add gpio chip %s\n",
 			pc->data->name);
-		goto fail;
-	}
-
-	ret = gpiochip_add_pin_range(&pc->chip, dev_name(pc->dev),
-				     0, pc->data->pin_base,
-				     pc->chip.ngpio);
-	if (ret) {
-		dev_err(pc->dev, "can't add pin range\n");
-		goto fail;
+		return ret;
 	}
 
 	return 0;
-fail:
-	gpiochip_remove(&pc->chip);
-
-	return ret;
 }
 
 static struct regmap_config meson_regmap_config = {
-- 
1.9.1

  parent reply	other threads:[~2017-03-23 16:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 16:27 [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog Neil Armstrong
2017-03-23 16:27 ` [RFT PATCH 1/6] ARM64: dts: meson-gxbb: Add gpio-ranges properties Neil Armstrong
2017-03-28  9:28   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 2/6] ARM64: dts: meson-gxl: " Neil Armstrong
2017-03-28  9:28   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 3/6] ARM: dts: meson8: " Neil Armstrong
2017-03-28  9:29   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 4/6] ARM: dts: meson8b: " Neil Armstrong
2017-03-28  9:29   ` Linus Walleij
2017-03-23 16:27 ` Neil Armstrong [this message]
2017-03-23 20:09   ` [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Martin Blumenstingl
2017-03-24 16:52     ` Neil Armstrong
2017-03-28  9:30   ` Linus Walleij
2017-03-28  9:38     ` Neil Armstrong
2017-03-28 14:57       ` Kevin Hilman
2017-03-28  9:40   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 6/6] ARM64: dts: meson-gxbb: Add USB Hub GPIO hog Neil Armstrong
2017-03-28  9:31   ` Linus Walleij
2017-03-24 20:11 ` [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490286449-19448-6-git-send-email-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=linus-amlogic@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox