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

xen: make remove callback of xen driver void returned

Since commit fc7a6209d571 ("bus: Make remove callback return void")
forces bus_type::remove be void-returned, it doesn't make much sense for
any bus based driver implementing remove callbalk to return non-void to
its caller.

This change is for xen bus based drivers.

Acked-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Link: https://lore.kernel.org/r/TYCP286MB23238119AB4DF190997075C9CAE39@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Dawei Li and committed by
Juergen Gross
7cffcade 8b997b2b

+22 -47
+1 -3
drivers/block/xen-blkback/xenbus.c
··· 524 524 return 0; 525 525 } 526 526 527 - static int xen_blkbk_remove(struct xenbus_device *dev) 527 + static void xen_blkbk_remove(struct xenbus_device *dev) 528 528 { 529 529 struct backend_info *be = dev_get_drvdata(&dev->dev); 530 530 ··· 547 547 /* Put the reference we set in xen_blkif_alloc(). */ 548 548 xen_blkif_put(be->blkif); 549 549 } 550 - 551 - return 0; 552 550 } 553 551 554 552 int xen_blkbk_flush_diskcache(struct xenbus_transaction xbt,
+1 -2
drivers/block/xen-blkfront.c
··· 2468 2468 } 2469 2469 } 2470 2470 2471 - static int blkfront_remove(struct xenbus_device *xbdev) 2471 + static void blkfront_remove(struct xenbus_device *xbdev) 2472 2472 { 2473 2473 struct blkfront_info *info = dev_get_drvdata(&xbdev->dev); 2474 2474 ··· 2489 2489 } 2490 2490 2491 2491 kfree(info); 2492 - return 0; 2493 2492 } 2494 2493 2495 2494 static int blkfront_is_ready(struct xenbus_device *dev)
+1 -2
drivers/char/tpm/xen-tpmfront.c
··· 360 360 return tpm_chip_register(priv->chip); 361 361 } 362 362 363 - static int tpmfront_remove(struct xenbus_device *dev) 363 + static void tpmfront_remove(struct xenbus_device *dev) 364 364 { 365 365 struct tpm_chip *chip = dev_get_drvdata(&dev->dev); 366 366 struct tpm_private *priv = dev_get_drvdata(&chip->dev); 367 367 tpm_chip_unregister(chip); 368 368 ring_free(priv); 369 369 dev_set_drvdata(&chip->dev, NULL); 370 - return 0; 371 370 } 372 371 373 372 static int tpmfront_resume(struct xenbus_device *dev)
+1 -2
drivers/gpu/drm/xen/xen_drm_front.c
··· 717 717 return xenbus_switch_state(xb_dev, XenbusStateInitialising); 718 718 } 719 719 720 - static int xen_drv_remove(struct xenbus_device *dev) 720 + static void xen_drv_remove(struct xenbus_device *dev) 721 721 { 722 722 struct xen_drm_front_info *front_info = dev_get_drvdata(&dev->dev); 723 723 int to = 100; ··· 751 751 752 752 xen_drm_drv_fini(front_info); 753 753 xenbus_frontend_closed(dev); 754 - return 0; 755 754 } 756 755 757 756 static const struct xenbus_device_id xen_driver_ids[] = {
+2 -3
drivers/input/misc/xen-kbdfront.c
··· 51 51 MODULE_PARM_DESC(ptr_size, 52 52 "Pointing device width, height in pixels (default 800,600)"); 53 53 54 - static int xenkbd_remove(struct xenbus_device *); 54 + static void xenkbd_remove(struct xenbus_device *); 55 55 static int xenkbd_connect_backend(struct xenbus_device *, struct xenkbd_info *); 56 56 static void xenkbd_disconnect_backend(struct xenkbd_info *); 57 57 ··· 404 404 return xenkbd_connect_backend(dev, info); 405 405 } 406 406 407 - static int xenkbd_remove(struct xenbus_device *dev) 407 + static void xenkbd_remove(struct xenbus_device *dev) 408 408 { 409 409 struct xenkbd_info *info = dev_get_drvdata(&dev->dev); 410 410 ··· 417 417 input_unregister_device(info->mtouch); 418 418 free_page((unsigned long)info->page); 419 419 kfree(info); 420 - return 0; 421 420 } 422 421 423 422 static int xenkbd_connect_backend(struct xenbus_device *dev,
+1 -2
drivers/net/xen-netback/xenbus.c
··· 977 977 return 0; 978 978 } 979 979 980 - static int netback_remove(struct xenbus_device *dev) 980 + static void netback_remove(struct xenbus_device *dev) 981 981 { 982 982 struct backend_info *be = dev_get_drvdata(&dev->dev); 983 983 ··· 992 992 kfree(be->hotplug_script); 993 993 kfree(be); 994 994 dev_set_drvdata(&dev->dev, NULL); 995 - return 0; 996 995 } 997 996 998 997 /*
+1 -3
drivers/net/xen-netfront.c
··· 2640 2640 } while (!ret); 2641 2641 } 2642 2642 2643 - static int xennet_remove(struct xenbus_device *dev) 2643 + static void xennet_remove(struct xenbus_device *dev) 2644 2644 { 2645 2645 struct netfront_info *info = dev_get_drvdata(&dev->dev); 2646 2646 ··· 2656 2656 rtnl_unlock(); 2657 2657 } 2658 2658 xennet_free_netdev(info->netdev); 2659 - 2660 - return 0; 2661 2659 } 2662 2660 2663 2661 static const struct xenbus_device_id netfront_ids[] = {
+1 -3
drivers/pci/xen-pcifront.c
··· 1055 1055 return err; 1056 1056 } 1057 1057 1058 - static int pcifront_xenbus_remove(struct xenbus_device *xdev) 1058 + static void pcifront_xenbus_remove(struct xenbus_device *xdev) 1059 1059 { 1060 1060 struct pcifront_device *pdev = dev_get_drvdata(&xdev->dev); 1061 1061 1062 1062 if (pdev) 1063 1063 free_pdev(pdev); 1064 - 1065 - return 0; 1066 1064 } 1067 1065 1068 1066 static const struct xenbus_device_id xenpci_ids[] = {
+1 -3
drivers/scsi/xen-scsifront.c
··· 995 995 return err; 996 996 } 997 997 998 - static int scsifront_remove(struct xenbus_device *dev) 998 + static void scsifront_remove(struct xenbus_device *dev) 999 999 { 1000 1000 struct vscsifrnt_info *info = dev_get_drvdata(&dev->dev); 1001 1001 ··· 1011 1011 1012 1012 scsifront_free_ring(info); 1013 1013 scsi_host_put(info->host); 1014 - 1015 - return 0; 1016 1014 } 1017 1015 1018 1016 static void scsifront_disconnect(struct vscsifrnt_info *info)
+2 -2
drivers/tty/hvc/hvc_xen.c
··· 394 394 return 0; 395 395 } 396 396 397 - static int xencons_remove(struct xenbus_device *dev) 397 + static void xencons_remove(struct xenbus_device *dev) 398 398 { 399 - return xen_console_remove(dev_get_drvdata(&dev->dev)); 399 + xen_console_remove(dev_get_drvdata(&dev->dev)); 400 400 } 401 401 402 402 static int xencons_connect_backend(struct xenbus_device *dev,
+1 -3
drivers/usb/host/xen-hcd.c
··· 1530 1530 } 1531 1531 } 1532 1532 1533 - static int xenhcd_remove(struct xenbus_device *dev) 1533 + static void xenhcd_remove(struct xenbus_device *dev) 1534 1534 { 1535 1535 struct xenhcd_info *info = dev_get_drvdata(&dev->dev); 1536 1536 struct usb_hcd *hcd = xenhcd_info_to_hcd(info); 1537 1537 1538 1538 xenhcd_destroy_rings(info); 1539 1539 usb_put_hcd(hcd); 1540 - 1541 - return 0; 1542 1540 } 1543 1541 1544 1542 static int xenhcd_probe(struct xenbus_device *dev,
+2 -4
drivers/video/fbdev/xen-fbfront.c
··· 67 67 "Video memory size in MB, width, height in pixels (default 2,800,600)"); 68 68 69 69 static void xenfb_make_preferred_console(void); 70 - static int xenfb_remove(struct xenbus_device *); 70 + static void xenfb_remove(struct xenbus_device *); 71 71 static void xenfb_init_shared_page(struct xenfb_info *, struct fb_info *); 72 72 static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *); 73 73 static void xenfb_disconnect_backend(struct xenfb_info *); ··· 527 527 return xenfb_connect_backend(dev, info); 528 528 } 529 529 530 - static int xenfb_remove(struct xenbus_device *dev) 530 + static void xenfb_remove(struct xenbus_device *dev) 531 531 { 532 532 struct xenfb_info *info = dev_get_drvdata(&dev->dev); 533 533 ··· 542 542 vfree(info->gfns); 543 543 vfree(info->fb); 544 544 kfree(info); 545 - 546 - return 0; 547 545 } 548 546 549 547 static unsigned long vmalloc_to_gfn(void *address)
+1 -2
drivers/xen/pvcalls-back.c
··· 1181 1181 } 1182 1182 } 1183 1183 1184 - static int pvcalls_back_remove(struct xenbus_device *dev) 1184 + static void pvcalls_back_remove(struct xenbus_device *dev) 1185 1185 { 1186 - return 0; 1187 1186 } 1188 1187 1189 1188 static int pvcalls_back_uevent(struct xenbus_device *xdev,
+1 -2
drivers/xen/pvcalls-front.c
··· 1085 1085 { "" } 1086 1086 }; 1087 1087 1088 - static int pvcalls_front_remove(struct xenbus_device *dev) 1088 + static void pvcalls_front_remove(struct xenbus_device *dev) 1089 1089 { 1090 1090 struct pvcalls_bedata *bedata; 1091 1091 struct sock_mapping *map = NULL, *n; ··· 1121 1121 kfree(bedata->ring.sring); 1122 1122 kfree(bedata); 1123 1123 xenbus_switch_state(dev, XenbusStateClosed); 1124 - return 0; 1125 1124 } 1126 1125 1127 1126 static int pvcalls_front_probe(struct xenbus_device *dev,
+1 -3
drivers/xen/xen-pciback/xenbus.c
··· 716 716 return err; 717 717 } 718 718 719 - static int xen_pcibk_xenbus_remove(struct xenbus_device *dev) 719 + static void xen_pcibk_xenbus_remove(struct xenbus_device *dev) 720 720 { 721 721 struct xen_pcibk_device *pdev = dev_get_drvdata(&dev->dev); 722 722 723 723 if (pdev != NULL) 724 724 free_pdev(pdev); 725 - 726 - return 0; 727 725 } 728 726 729 727 static const struct xenbus_device_id xen_pcibk_ids[] = {
+1 -3
drivers/xen/xen-scsiback.c
··· 1249 1249 spin_unlock_irqrestore(&info->v2p_lock, flags); 1250 1250 } 1251 1251 1252 - static int scsiback_remove(struct xenbus_device *dev) 1252 + static void scsiback_remove(struct xenbus_device *dev) 1253 1253 { 1254 1254 struct vscsibk_info *info = dev_get_drvdata(&dev->dev); 1255 1255 ··· 1261 1261 gnttab_page_cache_shrink(&info->free_pages, 0); 1262 1262 1263 1263 dev_set_drvdata(&dev->dev, NULL); 1264 - 1265 - return 0; 1266 1264 } 1267 1265 1268 1266 static int scsiback_probe(struct xenbus_device *dev,
+1 -1
include/xen/xenbus.h
··· 117 117 const struct xenbus_device_id *id); 118 118 void (*otherend_changed)(struct xenbus_device *dev, 119 119 enum xenbus_state backend_state); 120 - int (*remove)(struct xenbus_device *dev); 120 + void (*remove)(struct xenbus_device *dev); 121 121 int (*suspend)(struct xenbus_device *dev); 122 122 int (*resume)(struct xenbus_device *dev); 123 123 int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *);
+1 -2
net/9p/trans_xen.c
··· 303 303 kfree(priv); 304 304 } 305 305 306 - static int xen_9pfs_front_remove(struct xenbus_device *dev) 306 + static void xen_9pfs_front_remove(struct xenbus_device *dev) 307 307 { 308 308 struct xen_9pfs_front_priv *priv = dev_get_drvdata(&dev->dev); 309 309 310 310 dev_set_drvdata(&dev->dev, NULL); 311 311 xen_9pfs_front_free(priv); 312 - return 0; 313 312 } 314 313 315 314 static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev,
+1 -2
sound/xen/xen_snd_front.c
··· 311 311 return xenbus_switch_state(xb_dev, XenbusStateInitialising); 312 312 } 313 313 314 - static int xen_drv_remove(struct xenbus_device *dev) 314 + static void xen_drv_remove(struct xenbus_device *dev) 315 315 { 316 316 struct xen_snd_front_info *front_info = dev_get_drvdata(&dev->dev); 317 317 int to = 100; ··· 345 345 346 346 xen_snd_drv_fini(front_info); 347 347 xenbus_frontend_closed(dev); 348 - return 0; 349 348 } 350 349 351 350 static const struct xenbus_device_id xen_drv_ids[] = {