diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-03-26 07:09:00 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-04-21 03:50:07 -0400 |
commit | 3c3f4e012ab3471e8bd19220ed897ae9700e5fdd (patch) | |
tree | 4c0660ebae592cd0d3ee5e90edc72b086ab6267e | |
parent | 17672cf0a7cec57dea4c2a6705bd73114d5e9265 (diff) |
cdrom: cleanup hardcoded error-code
This patch eliminates hardcoded return value of register_cdrom().
It also changes the return value to -EINVAL.
It is more appropriate than -2 (-ENOENT) because it is only
happen invalid usage of register_cdrom() by broken cdrom driver.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | drivers/cdrom/cdrom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 82c7d212409c..fbcf4b3f8d0e 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -393,7 +393,7 @@ int register_cdrom(struct cdrom_device_info *cdi) | |||
393 | cdinfo(CD_OPEN, "entering register_cdrom\n"); | 393 | cdinfo(CD_OPEN, "entering register_cdrom\n"); |
394 | 394 | ||
395 | if (cdo->open == NULL || cdo->release == NULL) | 395 | if (cdo->open == NULL || cdo->release == NULL) |
396 | return -2; | 396 | return -EINVAL; |
397 | if (!banner_printed) { | 397 | if (!banner_printed) { |
398 | printk(KERN_INFO "Uniform CD-ROM driver " REVISION "\n"); | 398 | printk(KERN_INFO "Uniform CD-ROM driver " REVISION "\n"); |
399 | banner_printed = 1; | 399 | banner_printed = 1; |