[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080322031413.GE3665@APFDCB5C>
Date: Sat, 22 Mar 2008 12:14:14 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>,
Adrian McMenamin <adrian@...en.demon.co.uk>,
Borislav Petkov <petkovbb@...il.com>
Subject: [PATCH 5/5] 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: Akinobu Mita <akinobu.mita@...il.com>
Cc: Adrian McMenamin <adrian@...en.demon.co.uk>
Cc: Borislav Petkov <petkovbb@...il.com>
Cc: Jens Axboe <axboe@...nel.dk>
---
Documentation/cdrom/cdrom-standard.tex | 2 +-
drivers/cdrom/cdrom.c | 3 +--
drivers/cdrom/gdrom.c | 4 +++-
drivers/cdrom/viocd.c | 5 +----
drivers/ide/ide-cd.c | 5 ++---
include/linux/cdrom.h | 2 +-
6 files changed, 9 insertions(+), 12 deletions(-)
Index: 2.6-git/drivers/cdrom/cdrom.c
===================================================================
--- 2.6-git.orig/drivers/cdrom/cdrom.c
+++ 2.6-git/drivers/cdrom/cdrom.c
@@ -442,7 +442,7 @@ int register_cdrom(struct cdrom_device_i
}
#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
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: 2.6-git/drivers/cdrom/gdrom.c
===================================================================
--- 2.6-git.orig/drivers/cdrom/gdrom.c
+++ 2.6-git/drivers/cdrom/gdrom.c
@@ -827,7 +827,9 @@ static int __devexit remove_gdrom(struct
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: 2.6-git/drivers/cdrom/viocd.c
===================================================================
--- 2.6-git.orig/drivers/cdrom/viocd.c
+++ 2.6-git/drivers/cdrom/viocd.c
@@ -650,10 +650,7 @@ static int viocd_remove(struct vio_dev *
{
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: 2.6-git/include/linux/cdrom.h
===================================================================
--- 2.6-git.orig/include/linux/cdrom.h
+++ 2.6-git/include/linux/cdrom.h
@@ -995,7 +995,7 @@ extern int cdrom_ioctl(struct file *file
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;
Index: 2.6-git/Documentation/cdrom/cdrom-standard.tex
===================================================================
--- 2.6-git.orig/Documentation/cdrom/cdrom-standard.tex
+++ 2.6-git/Documentation/cdrom/cdrom-standard.tex
@@ -777,7 +777,7 @@ Note that a driver must have one static
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: 2.6-git/drivers/ide/ide-cd.c
===================================================================
--- 2.6-git.orig/drivers/ide/ide-cd.c
+++ 2.6-git/drivers/ide/ide-cd.c
@@ -2030,9 +2030,8 @@ static void ide_cd_release(struct 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists