Skip to content

Commit 15f83bb

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
s390/scm: Make struct scm_driver::remove return void
The driver core ignores the return value of scmdev_remove() (because there is only little it can do when a device disappears). So make it impossible for future drivers to return an unused error code by changing the remove prototype to return void. The real motivation for this change is the quest to make struct bus_type::remove return void, too. Reviewed-by: Cornelia Huck <[email protected]> Acked-by: Vineeth Vijayan <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7a47c52 commit 15f83bb

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

arch/s390/include/asm/eadm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ enum scm_event {SCM_CHANGE, SCM_AVAIL};
105105
struct scm_driver {
106106
struct device_driver drv;
107107
int (*probe) (struct scm_device *scmdev);
108-
int (*remove) (struct scm_device *scmdev);
108+
void (*remove) (struct scm_device *scmdev);
109109
void (*notify) (struct scm_device *scmdev, enum scm_event event);
110110
void (*handler) (struct scm_device *scmdev, void *data,
111111
blk_status_t error);

drivers/s390/block/scm_drv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,13 @@ static int scm_probe(struct scm_device *scmdev)
6060
return ret;
6161
}
6262

63-
static int scm_remove(struct scm_device *scmdev)
63+
static void scm_remove(struct scm_device *scmdev)
6464
{
6565
struct scm_blk_dev *bdev = dev_get_drvdata(&scmdev->dev);
6666

6767
scm_blk_dev_cleanup(bdev);
6868
dev_set_drvdata(&scmdev->dev, NULL);
6969
kfree(bdev);
70-
71-
return 0;
7270
}
7371

7472
static struct scm_driver scm_drv = {

drivers/s390/cio/scm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ static int scmdev_remove(struct device *dev)
3333
struct scm_device *scmdev = to_scm_dev(dev);
3434
struct scm_driver *scmdrv = to_scm_drv(dev->driver);
3535

36-
return scmdrv->remove ? scmdrv->remove(scmdev) : -ENODEV;
36+
if (scmdrv->remove)
37+
scmdrv->remove(scmdev);
38+
39+
return 0;
3740
}
3841

3942
static int scmdev_uevent(struct device *dev, struct kobj_uevent_env *env)

0 commit comments

Comments
 (0)