Commit 0a0c4114 authored by Akinobu Mita's avatar Akinobu Mita Committed by Jens Axboe

cdrom: make unregister_cdrom() return void

Now unregister_cdrom() always returns 0.
Make it return void and update all callers that check the return value.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 7fd097d4
...@@ -777,7 +777,7 @@ Note that a driver must have one static structure, $<device>_dops$, while ...@@ -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 it may have as many structures $<device>_info$ as there are minor devices
active. $Register_cdrom()$ builds a linked list from these. 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 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 the minor device from the list. If it was the last registered minor for
......
...@@ -442,7 +442,7 @@ int register_cdrom(struct cdrom_device_info *cdi) ...@@ -442,7 +442,7 @@ int register_cdrom(struct cdrom_device_info *cdi)
} }
#undef ENSURE #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"); cdinfo(CD_OPEN, "entering unregister_cdrom\n");
...@@ -455,7 +455,6 @@ int unregister_cdrom(struct cdrom_device_info *cdi) ...@@ -455,7 +455,6 @@ int unregister_cdrom(struct cdrom_device_info *cdi)
cdi->ops->n_minors--; cdi->ops->n_minors--;
cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name); cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name);
return 0;
} }
int cdrom_get_media_event(struct cdrom_device_info *cdi, int cdrom_get_media_event(struct cdrom_device_info *cdi,
......
...@@ -827,7 +827,9 @@ static int __devexit remove_gdrom(struct platform_device *devptr) ...@@ -827,7 +827,9 @@ static int __devexit remove_gdrom(struct platform_device *devptr)
del_gendisk(gd.disk); del_gendisk(gd.disk);
if (gdrom_major) if (gdrom_major)
unregister_blkdev(gdrom_major, GDROM_DEV_NAME); 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 = { static struct platform_driver gdrom_driver = {
......
...@@ -650,10 +650,7 @@ static int viocd_remove(struct vio_dev *vdev) ...@@ -650,10 +650,7 @@ static int viocd_remove(struct vio_dev *vdev)
{ {
struct disk_info *d = &viocd_diskinfo[vdev->unit_address]; struct disk_info *d = &viocd_diskinfo[vdev->unit_address];
if (unregister_cdrom(&d->viocd_info) != 0) unregister_cdrom(&d->viocd_info);
printk(VIOCD_KERN_WARNING
"Cannot unregister viocd CD-ROM %s!\n",
d->viocd_info.name);
del_gendisk(d->viocd_disk); del_gendisk(d->viocd_disk);
blk_cleanup_queue(d->viocd_disk->queue); blk_cleanup_queue(d->viocd_disk->queue);
put_disk(d->viocd_disk); put_disk(d->viocd_disk);
......
...@@ -2032,9 +2032,8 @@ static void ide_cd_release(struct kref *kref) ...@@ -2032,9 +2032,8 @@ static void ide_cd_release(struct kref *kref)
kfree(info->buffer); kfree(info->buffer);
kfree(info->toc); kfree(info->toc);
if (devinfo->handle == drive && unregister_cdrom(devinfo)) if (devinfo->handle == drive)
printk(KERN_ERR "%s: %s failed to unregister device from the cdrom " unregister_cdrom(devinfo);
"driver.\n", __FUNCTION__, drive->name);
drive->dsc_overlap = 0; drive->dsc_overlap = 0;
drive->driver_data = NULL; drive->driver_data = NULL;
blk_queue_prep_rq(drive->queue, NULL); blk_queue_prep_rq(drive->queue, NULL);
......
...@@ -995,7 +995,7 @@ extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi, ...@@ -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 cdrom_media_changed(struct cdrom_device_info *);
extern int register_cdrom(struct cdrom_device_info *cdi); 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 { typedef struct {
int data; int data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment