Skip to content

Commit

Permalink
cdrom: cleanup hardcoded error-code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
mita authored and Jens Axboe committed Apr 21, 2008
1 parent 17672cf commit 3c3f4e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3c3f4e0

Please sign in to comment.