mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-10-03 19:51:53 +02:00
mtd: Parse mtdparts/mtdids again when the MTD list has been updated
Updates to the MTD device list should trigger a new parsing of the mtdids/mtdparts vars even if those vars haven't changed. Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
4c47fd0b6b
commit
779c9c0565
@ -161,9 +161,13 @@ int mtd_probe_devices(void)
|
|||||||
|
|
||||||
mtd_probe_uclass_mtd_devs();
|
mtd_probe_uclass_mtd_devs();
|
||||||
|
|
||||||
/* Check if mtdparts/mtdids changed since last call, otherwise: exit */
|
/*
|
||||||
|
* Check if mtdparts/mtdids changed or if the MTD dev list was updated
|
||||||
|
* since last call, otherwise: exit
|
||||||
|
*/
|
||||||
if ((!mtdparts && !old_mtdparts && !mtdids && !old_mtdids) ||
|
if ((!mtdparts && !old_mtdparts && !mtdids && !old_mtdids) ||
|
||||||
(mtdparts && old_mtdparts && mtdids && old_mtdids &&
|
(mtdparts && old_mtdparts && mtdids && old_mtdids &&
|
||||||
|
!mtd_dev_list_updated() &&
|
||||||
!strcmp(mtdparts, old_mtdparts) &&
|
!strcmp(mtdparts, old_mtdparts) &&
|
||||||
!strcmp(mtdids, old_mtdids)))
|
!strcmp(mtdids, old_mtdids)))
|
||||||
return 0;
|
return 0;
|
||||||
@ -201,6 +205,12 @@ int mtd_probe_devices(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Call mtd_dev_list_updated() to clear updates generated by our own
|
||||||
|
* parts removal loop.
|
||||||
|
*/
|
||||||
|
mtd_dev_list_updated();
|
||||||
|
|
||||||
/* If either mtdparts or mtdids is empty, then exit */
|
/* If either mtdparts or mtdids is empty, then exit */
|
||||||
if (!mtdparts || !mtdids)
|
if (!mtdparts || !mtdids)
|
||||||
return 0;
|
return 0;
|
||||||
@ -281,6 +291,12 @@ int mtd_probe_devices(void)
|
|||||||
put_mtd_device(mtd);
|
put_mtd_device(mtd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Call mtd_dev_list_updated() to clear updates generated by our own
|
||||||
|
* parts registration loop.
|
||||||
|
*/
|
||||||
|
mtd_dev_list_updated();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user