mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] misc: sram: remove duplicated resource handling code
@ 2021-12-11  8:44 Ahmad Fatoum
  2021-12-13 22:23 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2021-12-11  8:44 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Remove superfluous code. No functional change.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/misc/sram.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index d45b5cb72f93..f4a7551fc760 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -26,24 +26,17 @@ static int sram_probe(struct device_d *dev)
 {
 	struct resource *iores;
 	struct sram *sram;
-	struct resource *res;
-	void __iomem *base;
 	int ret;
 
 	iores = dev_request_mem_resource(dev, 0);
 	if (IS_ERR(iores))
 		return PTR_ERR(iores);
-	base = IOMEM(iores->start);
 
 	sram = xzalloc(sizeof(*sram));
 
 	sram->cdev.name = basprintf("sram%d", cdev_find_free_index("sram"));
 
-	res = dev_get_resource(dev, IORESOURCE_MEM, 0);
-	if (IS_ERR(res))
-		return PTR_ERR(res);
-
-	sram->cdev.size = (unsigned long)resource_size(res);
+	sram->cdev.size = (unsigned long)resource_size(iores);
 	sram->cdev.ops = &memops;
 	sram->cdev.dev = dev;
 
-- 
2.33.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] misc: sram: remove duplicated resource handling code
  2021-12-11  8:44 [PATCH] misc: sram: remove duplicated resource handling code Ahmad Fatoum
@ 2021-12-13 22:23 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2021-12-13 22:23 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Sat, Dec 11, 2021 at 09:44:06AM +0100, Ahmad Fatoum wrote:
> Remove superfluous code. No functional change.
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
>  drivers/misc/sram.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
> index d45b5cb72f93..f4a7551fc760 100644
> --- a/drivers/misc/sram.c
> +++ b/drivers/misc/sram.c
> @@ -26,24 +26,17 @@ static int sram_probe(struct device_d *dev)
>  {
>  	struct resource *iores;
>  	struct sram *sram;
> -	struct resource *res;
> -	void __iomem *base;
>  	int ret;
>  
>  	iores = dev_request_mem_resource(dev, 0);
>  	if (IS_ERR(iores))
>  		return PTR_ERR(iores);
> -	base = IOMEM(iores->start);
>  
>  	sram = xzalloc(sizeof(*sram));
>  
>  	sram->cdev.name = basprintf("sram%d", cdev_find_free_index("sram"));
>  
> -	res = dev_get_resource(dev, IORESOURCE_MEM, 0);
> -	if (IS_ERR(res))
> -		return PTR_ERR(res);
> -
> -	sram->cdev.size = (unsigned long)resource_size(res);
> +	sram->cdev.size = (unsigned long)resource_size(iores);
>  	sram->cdev.ops = &memops;
>  	sram->cdev.dev = dev;
>  
> -- 
> 2.33.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:[~2021-12-13 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-11  8:44 [PATCH] misc: sram: remove duplicated resource handling code Ahmad Fatoum
2021-12-13 22:23 ` Sascha Hauer

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