Skip to contentSkip to conversation

GPIO: clps711x: Simplify initialization

PATCH Applied Alexander Shiyan 2 participants 2 messages Apr 19, 2022 – Apr 20, 2022 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GPIO: clps711x: Simplify initialization

---
 drivers/gpio/gpio-clps711x.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpio/gpio-clps711x.c +4 -6
index 67bce79bc3..a1965b33e4 100644
@@ -25,17 +25,15 @@ static int clps711x_gpio_probe(struct device_d *dev)
 		return PTR_ERR(iores);
 	dat = IOMEM(iores->start);
 
+	iores = dev_request_mem_resource(dev, 1);
+	if (IS_ERR(iores))
+		return PTR_ERR(iores);
+
 	switch (id) {
 	case 3:
-		iores = dev_request_mem_resource(dev, 1);
-		if (IS_ERR(iores))
-			return PTR_ERR(iores);
 		dir_inv = IOMEM(iores->start);
 		break;
 	default:
-		iores = dev_request_mem_resource(dev, 1);
-		if (IS_ERR(iores))
-			return PTR_ERR(iores);
 		dir = IOMEM(iores->start);
 		break;
 	}
Signature · 7 lines
2.32.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 4 lines · Alexander Shiyan
---
 drivers/gpio/gpio-clps711x.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Applied, thanks

Sascha

Quoted 36 lines
drivers/gpio/gpio-clps711x.c +4 -6
index 67bce79bc3..a1965b33e4 100644
@@ -25,17 +25,15 @@ static int clps711x_gpio_probe(struct device_d *dev)
 		return PTR_ERR(iores);
 	dat = IOMEM(iores->start);
 
+	iores = dev_request_mem_resource(dev, 1);
+	if (IS_ERR(iores))
+		return PTR_ERR(iores);
+
 	switch (id) {
 	case 3:
-		iores = dev_request_mem_resource(dev, 1);
-		if (IS_ERR(iores))
-			return PTR_ERR(iores);
 		dir_inv = IOMEM(iores->start);
 		break;
 	default:
-		iores = dev_request_mem_resource(dev, 1);
-		if (IS_ERR(iores))
-			return PTR_ERR(iores);
 		dir = IOMEM(iores->start);
 		break;
 	}
Signature · 7 lines
2.32.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox