summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-10-19 09:48:55 +0200
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-11-05 22:23:33 +0100
commit00142d6ffeb67b22e1f5259c9f3af540ed1d2b62 (patch)
treede8d5950194f631cd485662be05fe456f638d424 /drivers/mtd/maps
parent18d54e557c55fbf29d1a25fe2e1c01b0970f36cb (diff)
downloadlinux-00142d6ffeb67b22e1f5259c9f3af540ed1d2b62.tar.gz
linux-00142d6ffeb67b22e1f5259c9f3af540ed1d2b62.tar.bz2
linux-00142d6ffeb67b22e1f5259c9f3af540ed1d2b62.zip
mtd: maps: physmap: Rename ->map and ->mtd into ->maps and ->mtds
The ->map and ->mtd fields are actually arrays of map and mtd objects. Rename those fields into ->maps and ->mtds to make it obvious. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/physmap.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 19ec105cbb2d..4010afee4a33 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -25,9 +25,9 @@
#define MAX_RESOURCES 4
struct physmap_flash_info {
- struct mtd_info *mtd[MAX_RESOURCES];
+ struct mtd_info *mtds[MAX_RESOURCES];
struct mtd_info *cmtd;
- struct map_info map[MAX_RESOURCES];
+ struct map_info maps[MAX_RESOURCES];
spinlock_t vpp_lock;
int vpp_refcnt;
};
@@ -46,13 +46,13 @@ static int physmap_flash_remove(struct platform_device *dev)
if (info->cmtd) {
mtd_device_unregister(info->cmtd);
- if (info->cmtd != info->mtd[0])
+ if (info->cmtd != info->mtds[0])
mtd_concat_destroy(info->cmtd);
}
for (i = 0; i < MAX_RESOURCES; i++) {
- if (info->mtd[i] != NULL)
- map_destroy(info->mtd[i]);
+ if (info->mtds[i] != NULL)
+ map_destroy(info->mtds[i]);
}
if (physmap_data->exit)
@@ -136,48 +136,49 @@ static int physmap_flash_probe(struct platform_device *dev)
goto err_out;
}
- info->map[i].name = dev_name(&dev->dev);
- info->map[i].phys = dev->resource[i].start;
- info->map[i].size = resource_size(&dev->resource[i]);
- info->map[i].bankwidth = physmap_data->width;
- info->map[i].set_vpp = physmap_set_vpp;
- info->map[i].pfow_base = physmap_data->pfow_base;
- info->map[i].map_priv_1 = (unsigned long)dev;
-
- info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys,
- info->map[i].size);
- if (info->map[i].virt == NULL) {
+ info->maps[i].name = dev_name(&dev->dev);
+ info->maps[i].phys = dev->resource[i].start;
+ info->maps[i].size = resource_size(&dev->resource[i]);
+ info->maps[i].bankwidth = physmap_data->width;
+ info->maps[i].set_vpp = physmap_set_vpp;
+ info->maps[i].pfow_base = physmap_data->pfow_base;
+ info->maps[i].map_priv_1 = (unsigned long)dev;
+
+ info->maps[i].virt = devm_ioremap(&dev->dev,
+ info->maps[i].phys,
+ info->maps[i].size);
+ if (info->maps[i].virt == NULL) {
dev_err(&dev->dev, "Failed to ioremap flash region\n");
err = -EIO;
goto err_out;
}
- simple_map_init(&info->map[i]);
+ simple_map_init(&info->maps[i]);
probe_type = rom_probe_types;
if (physmap_data->probe_type == NULL) {
- for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++)
- info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
+ for (; info->mtds[i] == NULL && *probe_type != NULL; probe_type++)
+ info->mtds[i] = do_map_probe(*probe_type, &info->maps[i]);
} else
- info->mtd[i] = do_map_probe(physmap_data->probe_type, &info->map[i]);
+ info->mtds[i] = do_map_probe(physmap_data->probe_type, &info->maps[i]);
- if (info->mtd[i] == NULL) {
+ if (info->mtds[i] == NULL) {
dev_err(&dev->dev, "map_probe failed\n");
err = -ENXIO;
goto err_out;
} else {
devices_found++;
}
- info->mtd[i]->dev.parent = &dev->dev;
+ info->mtds[i]->dev.parent = &dev->dev;
}
if (devices_found == 1) {
- info->cmtd = info->mtd[0];
+ info->cmtd = info->mtds[0];
} else if (devices_found > 1) {
/*
* We detected multiple devices. Concatenate them together.
*/
- info->cmtd = mtd_concat_create(info->mtd, devices_found, dev_name(&dev->dev));
+ info->cmtd = mtd_concat_create(info->mtds, devices_found, dev_name(&dev->dev));
if (info->cmtd == NULL)
err = -ENXIO;
}
@@ -203,9 +204,9 @@ static void physmap_flash_shutdown(struct platform_device *dev)
struct physmap_flash_info *info = platform_get_drvdata(dev);
int i;
- for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
- if (mtd_suspend(info->mtd[i]) == 0)
- mtd_resume(info->mtd[i]);
+ for (i = 0; i < MAX_RESOURCES && info->mtds[i]; i++)
+ if (mtd_suspend(info->mtds[i]) == 0)
+ mtd_resume(info->mtds[i]);
}
#else
#define physmap_flash_shutdown NULL