@@ -6,6 +6,7 @@
#include <common.h>
#include <dm.h>
+#include <dm/device-internal.h>
#include <errno.h>
#include <mtd.h>
@@ -14,6 +15,14 @@
* The uclass private is pointed to mtd_info.
*/
+int mtd_probe(struct udevice *dev)
+{
+ if (device_active(dev))
+ return 0;
+
+ return device_probe(dev);
+}
+
UCLASS_DRIVER(mtd) = {
.id = UCLASS_MTD,
.name = "mtd",
@@ -538,5 +538,8 @@ int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off,
void mtd_get_len_incl_bad(struct mtd_info *mtd, uint64_t offset,
const uint64_t length, uint64_t *len_incl_bad,
int *truncated);
+
+int mtd_probe(struct udevice *dev);
+
#endif
#endif /* __MTD_MTD_H__ */
The user might want to trigger the probe of any MTD device, export these functions so they can be called from a command source file. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- drivers/mtd/mtd-uclass.c | 9 +++++++++ include/linux/mtd/mtd.h | 3 +++ 2 files changed, 12 insertions(+)