
Hi Miquel,
On Thu, 6 Sep 2018 09:08:53 +0200 Miquel Raynal miquel.raynal@bootlin.com wrote:
int ubi_part(char *part_name, const char *vid_header_offset) {
- struct mtd_info *mtd; int err = 0;
char mtd_dev[16];
struct mtd_device *dev;
struct part_info *part;
u8 pnum;
ubi_detach();
/*
* Search the mtd device number where this partition
* is located
*/
if (find_dev_and_part(part_name, &dev, &pnum, &part)) {
+#ifdef CONFIG_MTD
- mtd_probe_devices();
+#endif
Okay, so just like for the mtdparts patch, the #ifdef is incorrect, but more importantly, with you're rework, you're breaking all non-DM platforms, because the UBI layer no longer creates an MTD device on the fly, and the mtd partition creation won't take place if CONFIG_MTD is not activated.
My suggestion would be to make mtd_probe_devices() available to everyone (not only those who have CONFIG_MTD selected, which in turn depends on CONFIG_DM) so that the mtd part creation is done unconditionally, and you can safely get rid of the "dummy MTD device creation" done in UBI.
- mtd = get_mtd_device_nm(part_name);
- if (IS_ERR(mtd)) {
Regards,
Boris