Skip to contentSkip to conversation

misc: sram: remove duplicated resource handling code

PATCH Applied Ahmad Fatoum 2 participants 2 messages Dec 11, 2021 – Dec 13, 2021 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: sram: remove duplicated resource handling code

Remove superfluous code. No functional change.

---
 drivers/misc/sram.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/misc/sram.c +1 -8
index d45b5cb72f93..f4a7551fc760 100644
@@ -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;
 
Signature · 7 lines
2.33.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 6 lines · Ahmad Fatoum

Remove superfluous code. No functional change.

---
 drivers/misc/sram.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Applied, thanks

Sascha

Quoted 40 lines
drivers/misc/sram.c +1 -8
index d45b5cb72f93..f4a7551fc760 100644
@@ -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;
 
Signature · 7 lines
2.33.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