When there is no CDROM inserted, the block size is zero hence there is no need to create a BLK device for it.
Signed-off-by: Bin Meng <bmeng...@gmail.com> Reviewed-by: Simon Glass <s...@chromium.org> --- Changes in v3: None Changes in v2: None drivers/block/ide.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/block/ide.c b/drivers/block/ide.c index 1b5476e..0631fae 100644 --- a/drivers/block/ide.c +++ b/drivers/block/ide.c @@ -1199,6 +1199,13 @@ static int ide_probe(struct udevice *udev) blksz = ide_dev_desc[i].blksz; size = blksz * ide_dev_desc[i].lba; + + /* + * With CDROM, if there is no CD inserted, blksz will + * be zero, don't bother to create IDE block device. + */ + if (!blksz) + continue; ret = blk_create_devicef(udev, "ide_blk", name, IF_TYPE_IDE, i, blksz, size, &blk_dev); -- 2.9.2 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot