summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-02-07 08:56:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-02-07 09:11:28 +0100
commit3087e0c233e9f940a69f52d1f49cf10c2c999b1d (patch)
tree91029c22521aff850c3b0a93c4f13724e3a8195c /drivers
parente7f956403dbf5355033a44a2e8433557898eb830 (diff)
downloadbarebox-3087e0c233e9f940a69f52d1f49cf10c2c999b1d.tar.gz
barebox-3087e0c233e9f940a69f52d1f49cf10c2c999b1d.tar.xz
mtd: mtdram: discard superfluous code
We don't need to get the exact same resource, we just requested. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220207075630.1014476-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/devices/mtdram.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index ee1cbf792d..c9371b16d0 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -16,11 +16,6 @@
#include <malloc.h>
#include <of.h>
-struct mtdram_priv_data {
- struct mtd_info mtd;
- void *base;
-};
-
static int ram_erase(struct mtd_info *mtd, struct erase_info *instr)
{
memset((char *)mtd->priv + instr->addr, 0xff, instr->len);
@@ -44,10 +39,8 @@ static int ram_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retle
static int mtdram_probe(struct device_d *dev)
{
struct resource *iores;
- void __iomem *base;
int device_id;
struct mtd_info *mtd;
- struct resource *res;
loff_t size;
int ret = 0;
@@ -70,11 +63,9 @@ static int mtdram_probe(struct device_d *dev)
ret = PTR_ERR(iores);
goto nobase;
}
- base = IOMEM(iores->start);
- res = dev_get_resource(dev, IORESOURCE_MEM, 0);
- size = (unsigned long) resource_size(res);
- mtd->priv = base;
+ mtd->priv = IOMEM(iores->start);
+ size = (unsigned long) resource_size(iores);
mtd->type = MTD_RAM;
mtd->writesize = 1;