aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/cdrom/cdrom-standard.tex2
-rw-r--r--drivers/cdrom/cdrom.c3
-rw-r--r--drivers/cdrom/gdrom.c4
-rw-r--r--drivers/cdrom/viocd.c5
-rw-r--r--drivers/ide/ide-cd.c5
-rw-r--r--include/linux/cdrom.h2
6 files changed, 9 insertions, 12 deletions
diff --git a/Documentation/cdrom/cdrom-standard.tex b/Documentation/cdrom/cdrom-standard.tex
index c713aeb020c4..c06233fe52ac 100644
--- a/Documentation/cdrom/cdrom-standard.tex
+++ b/Documentation/cdrom/cdrom-standard.tex
@@ -777,7 +777,7 @@ Note that a driver must have one static structure, $<device>_dops$, while
777it may have as many structures $<device>_info$ as there are minor devices 777it may have as many structures $<device>_info$ as there are minor devices
778active. $Register_cdrom()$ builds a linked list from these. 778active. $Register_cdrom()$ builds a linked list from these.
779 779
780\subsection{$Int\ unregister_cdrom(struct\ cdrom_device_info * cdi)$} 780\subsection{$Void\ unregister_cdrom(struct\ cdrom_device_info * cdi)$}
781 781
782Unregistering device $cdi$ with minor number $MINOR(cdi\to dev)$ removes 782Unregistering device $cdi$ with minor number $MINOR(cdi\to dev)$ removes
783the minor device from the list. If it was the last registered minor for 783the minor device from the list. If it was the last registered minor for
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index c4213b7d0b20..663a7f7dc580 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -442,7 +442,7 @@ int register_cdrom(struct cdrom_device_info *cdi)
442} 442}
443#undef ENSURE 443#undef ENSURE
444 444
445int unregister_cdrom(struct cdrom_device_info *cdi) 445void unregister_cdrom(struct cdrom_device_info *cdi)
446{ 446{
447 cdinfo(CD_OPEN, "entering unregister_cdrom\n"); 447 cdinfo(CD_OPEN, "entering unregister_cdrom\n");
448 448
@@ -455,7 +455,6 @@ int unregister_cdrom(struct cdrom_device_info *cdi)
455 455
456 cdi->ops->n_minors--; 456 cdi->ops->n_minors--;
457 cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name); 457 cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name);
458 return 0;
459} 458}
460 459
461int cdrom_get_media_event(struct cdrom_device_info *cdi, 460int cdrom_get_media_event(struct cdrom_device_info *cdi,
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 4e2bbcccc064..71ec426ecffc 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -827,7 +827,9 @@ static int __devexit remove_gdrom(struct platform_device *devptr)
827 del_gendisk(gd.disk); 827 del_gendisk(gd.disk);
828 if (gdrom_major) 828 if (gdrom_major)
829 unregister_blkdev(gdrom_major, GDROM_DEV_NAME); 829 unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
830 return unregister_cdrom(gd.cd_info); 830 unregister_cdrom(gd.cd_info);
831
832 return 0;
831} 833}
832 834
833static struct platform_driver gdrom_driver = { 835static struct platform_driver gdrom_driver = {
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index cac06bc1754b..b74b6c2768a8 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -650,10 +650,7 @@ static int viocd_remove(struct vio_dev *vdev)
650{ 650{
651 struct disk_info *d = &viocd_diskinfo[vdev->unit_address]; 651 struct disk_info *d = &viocd_diskinfo[vdev->unit_address];
652 652
653 if (unregister_cdrom(&d->viocd_info) != 0) 653 unregister_cdrom(&d->viocd_info);
654 printk(VIOCD_KERN_WARNING
655 "Cannot unregister viocd CD-ROM %s!\n",
656 d->viocd_info.name);
657 del_gendisk(d->viocd_disk); 654 del_gendisk(d->viocd_disk);
658 blk_cleanup_queue(d->viocd_disk->queue); 655 blk_cleanup_queue(d->viocd_disk->queue);
659 put_disk(d->viocd_disk); 656 put_disk(d->viocd_disk);
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 396000208f81..fe5aefbf8339 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -2032,9 +2032,8 @@ static void ide_cd_release(struct kref *kref)
2032 2032
2033 kfree(info->buffer); 2033 kfree(info->buffer);
2034 kfree(info->toc); 2034 kfree(info->toc);
2035 if (devinfo->handle == drive && unregister_cdrom(devinfo)) 2035 if (devinfo->handle == drive)
2036 printk(KERN_ERR "%s: %s failed to unregister device from the cdrom " 2036 unregister_cdrom(devinfo);
2037 "driver.\n", __FUNCTION__, drive->name);
2038 drive->dsc_overlap = 0; 2037 drive->dsc_overlap = 0;
2039 drive->driver_data = NULL; 2038 drive->driver_data = NULL;
2040 blk_queue_prep_rq(drive->queue, NULL); 2039 blk_queue_prep_rq(drive->queue, NULL);
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index 40e05d0a6e45..5db265ea60f6 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -995,7 +995,7 @@ extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi,
995extern int cdrom_media_changed(struct cdrom_device_info *); 995extern int cdrom_media_changed(struct cdrom_device_info *);
996 996
997extern int register_cdrom(struct cdrom_device_info *cdi); 997extern int register_cdrom(struct cdrom_device_info *cdi);
998extern int unregister_cdrom(struct cdrom_device_info *cdi); 998extern void unregister_cdrom(struct cdrom_device_info *cdi);
999 999
1000typedef struct { 1000typedef struct {
1001 int data; 1001 int data;