From: Boris Brezillon <boris.brezillon@bootlin.com>
To: David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Boris Brezillon <boris.brezillon@bootlin.com>,
Marek Vasut <marek.vasut@gmail.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
devicetree@vger.kernel.org,
Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH v2 02/15] mtd: maps: physmap: Rename ->map and ->mtd into ->maps and ->mtds
Date: Fri, 19 Oct 2018 09:48:55 +0200 [thread overview]
Message-ID: <20181019074908.13226-3-boris.brezillon@bootlin.com> (raw)
In-Reply-To: <20181019074908.13226-1-boris.brezillon@bootlin.com>
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>
---
Changes in v2:
- Add Ricardo's R-b
---
drivers/mtd/maps/physmap.c | 55 +++++++++++++++++++++++-----------------------
1 file 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
--
2.14.1
next prev parent reply other threads:[~2018-10-19 7:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-19 7:48 [PATCH v2 00/15] mtd: maps: physmap cleanups Boris Brezillon
2018-10-19 7:48 ` [PATCH v2 01/15] mtd: maps: physmap: Add SPDX header Boris Brezillon
2018-10-19 7:48 ` Boris Brezillon [this message]
2018-10-19 7:48 ` [PATCH v2 03/15] mtd: maps: physmap: Use platform_get_resource() to retrieve iomem resources Boris Brezillon
2018-10-19 7:48 ` [PATCH v2 04/15] mtd: maps: physmap: Use dev_notice() and a %pR specifier Boris Brezillon
2018-10-19 7:48 ` [PATCH v2 05/15] mtd: maps: physmap: Use devm_ioremap_resource() Boris Brezillon
2018-10-19 7:48 ` [PATCH v2 06/15] mtd: maps: physmap: Remove the MAX_RESOURCES limitation Boris Brezillon
2018-10-19 7:49 ` [PATCH v2 07/15] mtd: maps: physmap: Check mtd_device_{parse_register, unregister}() ret code Boris Brezillon
2018-10-19 7:49 ` [PATCH v2 08/15] mtd: maps: physmap: Return -ENOMEM directly when info allocation fails Boris Brezillon
2018-10-19 7:49 ` [PATCH v2 09/15] mtd: maps: physmap: Fix coding style issues reported by checkpatch Boris Brezillon
2018-10-19 7:49 ` [PATCH v2 10/15] mtd: maps: Prepare merging of physmap and physmap_of Boris Brezillon
2018-10-19 7:49 ` [PATCH v2 11/15] mtd: maps: Merge physmap_of.c into physmap-core.c Boris Brezillon
2019-04-02 23:44 ` [v2,11/15] " Chris Packham
2019-04-03 2:02 ` [PATCH] mtd: maps: Allow MTD_PHYSMAP with MTD_RAM Chris Packham
2019-05-01 18:02 ` [v2,11/15] mtd: maps: Merge physmap_of.c into physmap-core.c Li Yang
2018-10-19 7:49 ` [PATCH v2 12/15] mtd: maps: Rename physmap_of_{versatile, gemini} into physmap-{versatile, gemini} Boris Brezillon
2018-10-19 7:49 ` [PATCH v2 13/15] dt-binding: mtd: physmap: Document the addr-gpios property Boris Brezillon
2018-10-24 18:38 ` Rob Herring
2018-10-31 10:49 ` Linus Walleij
2018-10-19 7:49 ` [PATCH v2 14/15] mtd: maps: Merge gpio-addr-flash.c into physmap-core.c Boris Brezillon
2018-10-19 7:49 ` [PATCH v2 15/15] mtd: maps: physmap: Invert logic on if/else branch Boris Brezillon
2018-10-22 11:45 ` [PATCH v2 00/15] mtd: maps: physmap cleanups Linus Walleij
2018-10-22 13:41 ` Boris Brezillon
2018-11-05 21:27 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181019074908.13226-3-boris.brezillon@bootlin.com \
--to=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linus.walleij@linaro.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=ricardo.ribalda@gmail.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).