aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-08-23 02:18:17 +0200
committerTom Rini <trini@konsulko.com>2023-08-30 17:56:21 -0400
commitd223dcf31ad04e3b363770f2e20a36f1c7716568 (patch)
treefd0dc2ca7f358343b4fb561485ff5bed51d69bf3 /include
parent95311f7a194aabc1a52d4f240fef36f21b3178fd (diff)
downloadu-boot-d223dcf31ad04e3b363770f2e20a36f1c7716568.zip
u-boot-d223dcf31ad04e3b363770f2e20a36f1c7716568.tar.gz
u-boot-d223dcf31ad04e3b363770f2e20a36f1c7716568.tar.bz2
drivers/mtd/nvmxip: Trigger post bind as probe on driver level
Perform all the block device creation only once, after the driver itself successfully bound. Do not do this in uclass post bind, as this might be triggered multiple times. For example the ut_dm_host test triggers this and triggers a memory leak that way, since there are now multiple block devices created using the blk_create_devicef() . To retain the old probe-on-boot behavior, set DM_FLAG_PROBE_AFTER_BIND flag in uclass post_bind callback, so the driver model would probe the driver at the right time. Rename the function as well, to match similar functions in other block-related subsystems, like the mmc one. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Diffstat (limited to 'include')
-rw-r--r--include/nvmxip.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/nvmxip.h b/include/nvmxip.h
index f4ef377..726fffe 100644
--- a/include/nvmxip.h
+++ b/include/nvmxip.h
@@ -29,4 +29,16 @@ struct nvmxip_plat {
lbaint_t lba;
};
+/**
+ * nvmxip_bind() - post binding treatments
+ * @dev: the NVMXIP device
+ *
+ * Create and probe a child block device.
+ *
+ * Return:
+ *
+ * 0 on success. Otherwise, failure
+ */
+int nvmxip_probe(struct udevice *udev);
+
#endif /* __DRIVER_NVMXIP_H__ */