Skip to content

Commit

Permalink
vme: make remove callback return void
Browse files Browse the repository at this point in the history
The driver core ignores the return value of struct bus_type::remove()
because there is only little that can be done. To simplify the quest to
make this function return void, let struct vme_driver::remove return void,
too. There is only a single vme driver and it already returns 0
unconditionally in .remove().

Also fix the bus remove function to always return 0.

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]>
  • Loading branch information
ukleinek authored and gregkh committed Feb 9, 2021
1 parent 5f68053 commit 2adc75f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/vme/devices/vme_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ static int vme_user_probe(struct vme_dev *vdev)
return err;
}

static int vme_user_remove(struct vme_dev *dev)
static void vme_user_remove(struct vme_dev *dev)
{
int i;

Expand Down Expand Up @@ -717,8 +717,6 @@ static int vme_user_remove(struct vme_dev *dev)

/* Unregister the major and minor device numbers */
unregister_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS);

return 0;
}

static struct vme_driver vme_user_driver = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/vme/vme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,9 +1997,9 @@ static int vme_bus_remove(struct device *dev)

driver = dev->platform_data;
if (driver->remove)
return driver->remove(vdev);
driver->remove(vdev);

return -ENODEV;
return 0;
}

struct bus_type vme_bus_type = {
Expand Down
2 changes: 1 addition & 1 deletion include/linux/vme.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct vme_driver {
const char *name;
int (*match)(struct vme_dev *);
int (*probe)(struct vme_dev *);
int (*remove)(struct vme_dev *);
void (*remove)(struct vme_dev *);
struct device_driver driver;
struct list_head devices;
};
Expand Down

0 comments on commit 2adc75f

Please sign in to comment.