public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] GPIO: omap_gpio: Fix gpio name names with device tree
Date: Fri, 17 Aug 2018 14:37:58 -0500	[thread overview]
Message-ID: <20180817193758.21009-1-aford173@gmail.com> (raw)

The GPIO bank numbers do not appear in the device tree, so this
patch makes the gpio name based on the address
(ie gpio at 49054000_31 vs gpio4_31)

adam

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
index 651f6994e4..0f1ddeff92 100644
--- a/drivers/gpio/omap_gpio.c
+++ b/drivers/gpio/omap_gpio.c
@@ -288,11 +288,9 @@ static int omap_gpio_probe(struct udevice *dev)
 	struct gpio_bank *bank = dev_get_priv(dev);
 	struct omap_gpio_platdata *plat = dev_get_platdata(dev);
 	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-	int banknum;
 	char name[18], *str;
 
-	banknum = plat->bank_index;
-	sprintf(name, "GPIO%d_", banknum + 1);
+	sprintf(name, "gpio@%4x_", (unsigned int)plat->base);
 	str = strdup(name);
 	if (!str)
 		return -ENOMEM;
-- 
2.17.1

             reply	other threads:[~2018-08-17 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 19:37 Adam Ford [this message]
2018-08-26 19:54 ` [U-Boot] [PATCH] GPIO: omap_gpio: Fix gpio name names with device tree Derald D. Woods
2018-09-18 21:24 ` [U-Boot] " Tom Rini

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=20180817193758.21009-1-aford173@gmail.com \
    --to=aford173@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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