diff options
author | Marek Behún <marek.behun@nic.cz> | 2021-05-26 15:08:22 +0300 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2021-06-24 09:24:07 +0300 |
commit | 69e57c4753dd5428e9e5ed6d1399c8532f744efc (patch) | |
tree | 83ceb099eb54406483469b4a2be0251301680345 /drivers/mtd/mtd_uboot.c | |
parent | 2d1a9a6b265f79be495201dadf7f3aa315b8a5e3 (diff) | |
download | u-boot-69e57c4753dd5428e9e5ed6d1399c8532f744efc.tar.xz |
mtd: remove mtd_probe() function
The device_probe() function does the same thing as mtd_probe() and
mtd_probe() is only used in mtd_probe_uclass_mtd_devs(), where the
probing can be made simpler by using uclass_foreach_dev_probe macro.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers/mtd/mtd_uboot.c')
-rw-r--r-- | drivers/mtd/mtd_uboot.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mtd/mtd_uboot.c b/drivers/mtd/mtd_uboot.c index 4843cf1b84..a652d431ba 100644 --- a/drivers/mtd/mtd_uboot.c +++ b/drivers/mtd/mtd_uboot.c @@ -9,6 +9,7 @@ #include <malloc.h> #include <dm/device.h> #include <dm/uclass-internal.h> +#include <dm/uclass.h> #include <linux/err.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> @@ -106,13 +107,9 @@ int mtd_search_alternate_name(const char *mtdname, char *altname, static void mtd_probe_uclass_mtd_devs(void) { struct udevice *dev; - int idx = 0; - /* Probe devices with DM compliant drivers */ - while (!uclass_find_device(UCLASS_MTD, idx, &dev) && dev) { - mtd_probe(dev); - idx++; - } + uclass_foreach_dev_probe(UCLASS_MTD, dev) + ; } #else static void mtd_probe_uclass_mtd_devs(void) { } |