summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/block/ide.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index ed3b27e6e7..9ab01a9861 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -1202,6 +1202,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);