* [PATCH] gpio: orion: Do not overwrite device id
@ 2021-02-04 10:49 Sascha Hauer
0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2021-02-04 10:49 UTC (permalink / raw)
To: Barebox List
The driver has no busyness manipulating the id field in the given device
struct. Leave it untouched.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/gpio/gpio-orion.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-orion.c b/drivers/gpio/gpio-orion.c
index 63ef966edf..ba2729d1f0 100644
--- a/drivers/gpio/gpio-orion.c
+++ b/drivers/gpio/gpio-orion.c
@@ -91,10 +91,7 @@ static int orion_gpio_probe(struct device_d *dev)
{
struct resource *iores;
struct orion_gpio_chip *gpio;
-
- dev->id = of_alias_get_id(dev->device_node, "gpio");
- if (dev->id < 0)
- return dev->id;
+ int id;
gpio = xzalloc(sizeof(*gpio));
iores = dev_request_mem_resource(dev, 0);
@@ -105,7 +102,12 @@ static int orion_gpio_probe(struct device_d *dev)
gpio->regs = IOMEM(iores->start);
gpio->chip.dev = dev;
gpio->chip.ops = &orion_gpio_ops;
- gpio->chip.base = dev->id * 32;
+
+ id = of_alias_get_id(dev->device_node, "gpio");
+ if (id < 0)
+ return id;
+
+ gpio->chip.base = id * 32;
gpio->chip.ngpio = 32;
of_property_read_u32(dev->device_node, "ngpios", &gpio->chip.ngpio);
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-04 10:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 10:49 [PATCH] gpio: orion: Do not overwrite device id Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox