summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2021-12-11 09:44:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-12-13 23:23:15 +0100
commit2962e19b55e970c7a2f1b0048abf1ef95463c6f5 (patch)
treec42b2feb3a0c0de9f40f46cb6990eeb19d90eaf0 /drivers/misc
parentef2fe9f793c0796beea292a12ad0a1577645ef01 (diff)
downloadbarebox-2962e19b55e970c7a2f1b0048abf1ef95463c6f5.tar.gz
barebox-2962e19b55e970c7a2f1b0048abf1ef95463c6f5.tar.xz
misc: sram: remove duplicated resource handling code
Remove superfluous code. No functional change. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20211211084406.448795-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/sram.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index d45b5cb72f..f4a7551fc7 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;