]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
cdrom: cleanup hardcoded error-code
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 26 Mar 2008 11:09:00 +0000 (12:09 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 21 Apr 2008 07:50:07 +0000 (09:50 +0200)
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>
drivers/cdrom/cdrom.c

index 82c7d212409ceb8b95f98ce30e48dcfc92519cba..fbcf4b3f8d0e699539dadf6acaa93e5c89c09efb 100644 (file)
@@ -393,7 +393,7 @@ int register_cdrom(struct cdrom_device_info *cdi)
        cdinfo(CD_OPEN, "entering register_cdrom\n"); 
 
        if (cdo->open == NULL || cdo->release == NULL)
-               return -2;
+               return -EINVAL;
        if (!banner_printed) {
                printk(KERN_INFO "Uniform CD-ROM driver " REVISION "\n");
                banner_printed = 1;