From 3c3f4e012ab3471e8bd19220ed897ae9700e5fdd Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Wed, 26 Mar 2008 12:09:00 +0100 Subject: [PATCH] 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 Signed-off-by: Jens Axboe --- drivers/cdrom/cdrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 82c7d21240..fbcf4b3f8d 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -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; -- 2.39.5