vio: make remove callback return void
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 vio_driver::remove() return void, too. All users already unconditionally return 0, this commit makes it obvious that returning an error code is a bad idea. Note there are two nominally different implementations for a vio bus: one in arch/sparc/kernel/vio.c and the other in arch/powerpc/platforms/pseries/vio.c. This patch only adapts the powerpc one. Before this patch for a device that was bound to a driver without a remove callback vio_cmo_bus_remove(viodev) wasn't called. As the device core still considers the device unbound after vio_bus_remove() returns calling this unconditionally is the consistent behaviour which is implemented here. Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com> Acked-by: Lijun Pan <ljp@linux.ibm.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [mpe: Drop unneeded hvcs_remove() forward declaration, squash in change from sfr to drop ibmvnic_remove() forward declaration] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210225221834.160083-1-uwe@kleine-koenig.org
This commit is contained in:
committed by
Michael Ellerman
parent
91b6c5dbe9
commit
386a966f5c
@@ -78,7 +78,6 @@ MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(IBMVNIC_DRIVER_VERSION);
|
||||
|
||||
static int ibmvnic_version = IBMVNIC_INITIAL_VERSION;
|
||||
static int ibmvnic_remove(struct vio_dev *);
|
||||
static void release_sub_crqs(struct ibmvnic_adapter *, bool);
|
||||
static int ibmvnic_reset_crq(struct ibmvnic_adapter *);
|
||||
static int ibmvnic_send_crq_init(struct ibmvnic_adapter *);
|
||||
@@ -5396,7 +5395,7 @@ ibmvnic_init_fail:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int ibmvnic_remove(struct vio_dev *dev)
|
||||
static void ibmvnic_remove(struct vio_dev *dev)
|
||||
{
|
||||
struct net_device *netdev = dev_get_drvdata(&dev->dev);
|
||||
struct ibmvnic_adapter *adapter = netdev_priv(netdev);
|
||||
@@ -5437,8 +5436,6 @@ static int ibmvnic_remove(struct vio_dev *dev)
|
||||
device_remove_file(&dev->dev, &dev_attr_failover);
|
||||
free_netdev(netdev);
|
||||
dev_set_drvdata(&dev->dev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t failover_store(struct device *dev, struct device_attribute *attr,
|
||||
|
||||
Reference in New Issue
Block a user