mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] GPIO: clps711x: Simplify initialization
@ 2022-04-19  9:36 Alexander Shiyan
  2022-04-20  6:46 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2022-04-19  9:36 UTC (permalink / raw)
  To: barebox; +Cc: Alexander Shiyan

Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 drivers/gpio/gpio-clps711x.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-clps711x.c b/drivers/gpio/gpio-clps711x.c
index 67bce79bc3..a1965b33e4 100644
--- a/drivers/gpio/gpio-clps711x.c
+++ b/drivers/gpio/gpio-clps711x.c
@@ -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;
 	}
-- 
2.32.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] GPIO: clps711x: Simplify initialization
  2022-04-19  9:36 [PATCH] GPIO: clps711x: Simplify initialization Alexander Shiyan
@ 2022-04-20  6:46 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-04-20  6:46 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Tue, Apr 19, 2022 at 12:36:06PM +0300, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> ---
>  drivers/gpio/gpio-clps711x.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/gpio/gpio-clps711x.c b/drivers/gpio/gpio-clps711x.c
> index 67bce79bc3..a1965b33e4 100644
> --- a/drivers/gpio/gpio-clps711x.c
> +++ b/drivers/gpio/gpio-clps711x.c
> @@ -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;
>  	}
> -- 
> 2.32.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-20  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19  9:36 [PATCH] GPIO: clps711x: Simplify initialization Alexander Shiyan
2022-04-20  6:46 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox