mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-26 00:01:48 +02:00
scsi: Remove all children of SCSI devices before rescanning
At present this only unbinds block devices of a certain type. But SCSI device can have different types of children, including bootdevs. Unbind all children so tht everything is clean and ready for a new scan. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
ca93d28171
commit
6febc26471
@ -644,12 +644,23 @@ int scsi_scan(bool verbose)
|
|||||||
if (verbose)
|
if (verbose)
|
||||||
printf("scanning bus for devices...\n");
|
printf("scanning bus for devices...\n");
|
||||||
|
|
||||||
blk_unbind_all(UCLASS_SCSI);
|
|
||||||
|
|
||||||
ret = uclass_get(UCLASS_SCSI, &uc);
|
ret = uclass_get(UCLASS_SCSI, &uc);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/* remove all children of the SCSI devices */
|
||||||
|
uclass_foreach_dev(dev, uc) {
|
||||||
|
log_debug("unbind %s\n", dev->name);
|
||||||
|
ret = device_chld_remove(dev, NULL, DM_REMOVE_NORMAL);
|
||||||
|
if (!ret)
|
||||||
|
ret = device_chld_unbind(dev, NULL);
|
||||||
|
if (ret) {
|
||||||
|
if (verbose)
|
||||||
|
printf("unable to unbind devices (%dE)\n", ret);
|
||||||
|
return log_msg_ret("unb", ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uclass_foreach_dev(dev, uc) {
|
uclass_foreach_dev(dev, uc) {
|
||||||
ret = scsi_scan_dev(dev, verbose);
|
ret = scsi_scan_dev(dev, verbose);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user