cdrom: make unregister_cdrom() return void
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 26 Mar 2008 11:09:02 +0000 (12:09 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 21 Apr 2008 07:50:08 +0000 (09:50 +0200)
Now unregister_cdrom() always returns 0.
Make it return void and update all callers that check the return value.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Documentation/cdrom/cdrom-standard.tex
drivers/cdrom/cdrom.c
drivers/cdrom/gdrom.c
drivers/cdrom/viocd.c
drivers/ide/ide-cd.c
include/linux/cdrom.h

index c713aeb020c40f6bfba883031d87e83e9d783b09..c06233fe52ac2bea917e4e850551b2733f8d341f 100644 (file)
@@ -777,7 +777,7 @@ Note that a driver must have one static structure, $<device>_dops$, while
 it may have as many structures $<device>_info$ as there are minor devices
 active. $Register_cdrom()$ builds a linked list from these. 
 
-\subsection{$Int\ unregister_cdrom(struct\ cdrom_device_info * cdi)$}
+\subsection{$Void\ unregister_cdrom(struct\ cdrom_device_info * cdi)$}
 
 Unregistering device $cdi$ with minor number $MINOR(cdi\to dev)$ removes
 the minor device from the list. If it was the last registered minor for
index c4213b7d0b20c1ddf0a213e073c991d3ef917bb8..663a7f7dc580864d23afe0f1217b754bc8f3179f 100644 (file)
@@ -442,7 +442,7 @@ int register_cdrom(struct cdrom_device_info *cdi)
 }
 #undef ENSURE
 
-int unregister_cdrom(struct cdrom_device_info *cdi)
+void unregister_cdrom(struct cdrom_device_info *cdi)
 {
        cdinfo(CD_OPEN, "entering unregister_cdrom\n"); 
 
@@ -455,7 +455,6 @@ int unregister_cdrom(struct cdrom_device_info *cdi)
 
        cdi->ops->n_minors--;
        cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name);
-       return 0;
 }
 
 int cdrom_get_media_event(struct cdrom_device_info *cdi,
index 4e2bbcccc0641c33b22669dcaa352e3d7893591e..71ec426ecffc4f17d9c9237b6aebdc4e13cc385f 100644 (file)
@@ -827,7 +827,9 @@ static int __devexit remove_gdrom(struct platform_device *devptr)
        del_gendisk(gd.disk);
        if (gdrom_major)
                unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
-       return unregister_cdrom(gd.cd_info);
+       unregister_cdrom(gd.cd_info);
+
+       return 0;
 }
 
 static struct platform_driver gdrom_driver = {
index cac06bc1754b327f7e88605c4f1ed838d8187966..b74b6c2768a8fbcd15d0468dc33fbe450e843609 100644 (file)
@@ -650,10 +650,7 @@ static int viocd_remove(struct vio_dev *vdev)
 {
        struct disk_info *d = &viocd_diskinfo[vdev->unit_address];
 
-       if (unregister_cdrom(&d->viocd_info) != 0)
-               printk(VIOCD_KERN_WARNING
-                               "Cannot unregister viocd CD-ROM %s!\n",
-                               d->viocd_info.name);
+       unregister_cdrom(&d->viocd_info);
        del_gendisk(d->viocd_disk);
        blk_cleanup_queue(d->viocd_disk->queue);
        put_disk(d->viocd_disk);
index 396000208f81ddd19062259724de074863110a3c..fe5aefbf83392fae89553050dd484dcf108fd428 100644 (file)
@@ -2032,9 +2032,8 @@ static void ide_cd_release(struct kref *kref)
 
        kfree(info->buffer);
        kfree(info->toc);
-       if (devinfo->handle == drive && unregister_cdrom(devinfo))
-               printk(KERN_ERR "%s: %s failed to unregister device from the cdrom "
-                               "driver.\n", __FUNCTION__, drive->name);
+       if (devinfo->handle == drive)
+               unregister_cdrom(devinfo);
        drive->dsc_overlap = 0;
        drive->driver_data = NULL;
        blk_queue_prep_rq(drive->queue, NULL);
index 40e05d0a6e45757b83e046edd2a17df84f0c616e..5db265ea60f625a8e281f3ae004a7d90f15f6e00 100644 (file)
@@ -995,7 +995,7 @@ extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi,
 extern int cdrom_media_changed(struct cdrom_device_info *);
 
 extern int register_cdrom(struct cdrom_device_info *cdi);
-extern int unregister_cdrom(struct cdrom_device_info *cdi);
+extern void unregister_cdrom(struct cdrom_device_info *cdi);
 
 typedef struct {
     int data;