Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc/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 and should prevent
that future driver authors consider returning an error code.

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 addresses the
former.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210505201449.195627-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
1553573c a56dfb6a

+7 -19
+1 -1
arch/sparc/include/asm/vio.h
··· 362 362 struct list_head node; 363 363 const struct vio_device_id *id_table; 364 364 int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); 365 - int (*remove)(struct vio_dev *dev); 365 + void (*remove)(struct vio_dev *dev); 366 366 void (*shutdown)(struct vio_dev *dev); 367 367 unsigned long driver_data; 368 368 struct device_driver driver;
-6
arch/sparc/kernel/ds.c
··· 1236 1236 return err; 1237 1237 } 1238 1238 1239 - static int ds_remove(struct vio_dev *vdev) 1240 - { 1241 - return 0; 1242 - } 1243 - 1244 1239 static const struct vio_device_id ds_match[] = { 1245 1240 { 1246 1241 .type = "domain-services-port", ··· 1246 1251 static struct vio_driver ds_driver = { 1247 1252 .id_table = ds_match, 1248 1253 .probe = ds_probe, 1249 - .remove = ds_remove, 1250 1254 .name = "ds", 1251 1255 }; 1252 1256
+2 -2
arch/sparc/kernel/vio.c
··· 105 105 * routines to do so at the moment. TBD 106 106 */ 107 107 108 - return drv->remove(vdev); 108 + drv->remove(vdev); 109 109 } 110 110 111 - return 1; 111 + return 0; 112 112 } 113 113 114 114 static ssize_t devspec_show(struct device *dev,
+1 -2
drivers/block/sunvdc.c
··· 1071 1071 return err; 1072 1072 } 1073 1073 1074 - static int vdc_port_remove(struct vio_dev *vdev) 1074 + static void vdc_port_remove(struct vio_dev *vdev) 1075 1075 { 1076 1076 struct vdc_port *port = dev_get_drvdata(&vdev->dev); 1077 1077 ··· 1094 1094 1095 1095 kfree(port); 1096 1096 } 1097 - return 0; 1098 1097 } 1099 1098 1100 1099 static void vdc_requeue_inflight(struct vdc_port *port)
+1 -3
drivers/net/ethernet/sun/ldmvsw.c
··· 404 404 return err; 405 405 } 406 406 407 - static int vsw_port_remove(struct vio_dev *vdev) 407 + static void vsw_port_remove(struct vio_dev *vdev) 408 408 { 409 409 struct vnet_port *port = dev_get_drvdata(&vdev->dev); 410 410 unsigned long flags; ··· 430 430 431 431 free_netdev(port->dev); 432 432 } 433 - 434 - return 0; 435 433 } 436 434 437 435 static void vsw_cleanup(void)
+1 -2
drivers/net/ethernet/sun/sunvnet.c
··· 510 510 return err; 511 511 } 512 512 513 - static int vnet_port_remove(struct vio_dev *vdev) 513 + static void vnet_port_remove(struct vio_dev *vdev) 514 514 { 515 515 struct vnet_port *port = dev_get_drvdata(&vdev->dev); 516 516 ··· 533 533 534 534 kfree(port); 535 535 } 536 - return 0; 537 536 } 538 537 539 538 static const struct vio_device_id vnet_port_match[] = {
+1 -3
drivers/tty/vcc.c
··· 668 668 * 669 669 * Return: status of removal 670 670 */ 671 - static int vcc_remove(struct vio_dev *vdev) 671 + static void vcc_remove(struct vio_dev *vdev) 672 672 { 673 673 struct vcc_port *port = dev_get_drvdata(&vdev->dev); 674 674 ··· 703 703 kfree(port->domain); 704 704 kfree(port); 705 705 } 706 - 707 - return 0; 708 706 } 709 707 710 708 static const struct vio_device_id vcc_match[] = {