Skip to content

Commit

Permalink
cdrom: make unregister_cdrom() return void
Browse files Browse the repository at this point in the history
Now unregister_cdrom() always returns 0.
Make it return void and update all callers that check the return value.

Signed-off-by: Akinobu Mita <[email protected]>
Cc: Adrian McMenamin <[email protected]>
Cc: Borislav Petkov <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
mita authored and Jens Axboe committed Apr 21, 2008
1 parent 7fd097d commit 0a0c411
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Documentation/cdrom/cdrom-standard.tex
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ \subsection{$Int\ register_cdrom( struct\ cdrom_device_info\ * cdi)$}
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
Expand Down
3 changes: 1 addition & 2 deletions drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion drivers/cdrom/gdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
5 changes: 1 addition & 4 deletions drivers/cdrom/viocd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/cdrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a0c411

Please sign in to comment.