diff options
author | sos <sos@FreeBSD.org> | 2006-03-08 09:21:48 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2006-03-08 09:21:48 +0000 |
commit | d987f74f35d5b995297b06cf5476b706257868cb (patch) | |
tree | 3a52e5757ef7b32f50510dd78e4ff11720970073 | |
parent | 59d0573b934949404abbe2c4473920f8910c8708 (diff) | |
download | FreeBSD-src-d987f74f35d5b995297b06cf5476b706257868cb.zip FreeBSD-src-d987f74f35d5b995297b06cf5476b706257868cb.tar.gz |
Bail out of afd_sense if ENODEV.
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index b4e6c8b..78887c6 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -309,11 +309,16 @@ afd_sense(device_t dev) sizeof(struct afd_capabilities) & 0xff, 0, 0, 0, 0, 0, 0, 0 }; int timeout = 20; - int count; + int error, count; + + fdp->mediasize = 0; /* wait for device to get ready */ - while (afd_test_ready(dev) && timeout--) + while ((error = afd_test_ready(dev)) && timeout--) { DELAY(100000); + } + if (error == ENODEV) + return 1; /* The IOMEGA Clik! doesn't support reading the cap page, fake it */ if (!strncmp(atadev->param.model, "IOMEGA Clik!", 12)) { @@ -363,7 +368,6 @@ afd_sense(device_t dev) return 0; } } - fdp->mediasize = 0; return 1; } |