Drivers: hv: Make remove callback of hyperv driver void returned
authorDawei Li <set_pte_at@outlook.com>
Thu, 5 Jan 2023 14:51:23 +0000 (22:51 +0800)
committerWei Liu <wei.liu@kernel.org>
Tue, 17 Jan 2023 13:41:27 +0000 (13:41 +0000)
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.

As such, change the remove function for Hyper-V VMBus based
drivers to return void.

Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Link: https://lore.kernel.org/r/TYCP286MB2323A93C55526E4DF239D3ACCAFA9@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM
Signed-off-by: Wei Liu <wei.liu@kernel.org>
12 files changed:
drivers/gpu/drm/hyperv/hyperv_drm_drv.c
drivers/hid/hid-hyperv.c
drivers/hv/hv_balloon.c
drivers/hv/hv_util.c
drivers/input/serio/hyperv-keyboard.c
drivers/net/hyperv/netvsc_drv.c
drivers/pci/controller/pci-hyperv.c
drivers/scsi/storvsc_drv.c
drivers/uio/uio_hv_generic.c
drivers/video/fbdev/hyperv_fb.c
include/linux/hyperv.h
net/vmw_vsock/hyperv_transport.c

index 427c20ba34045a30cf3b7bf0871f7f977f18b5e4..f830d62a5ce6047a3b88570ba6ad76162fe9a1ad 100644 (file)
@@ -165,7 +165,7 @@ err_hv_set_drv_data:
        return ret;
 }
 
-static int hyperv_vmbus_remove(struct hv_device *hdev)
+static void hyperv_vmbus_remove(struct hv_device *hdev)
 {
        struct drm_device *dev = hv_get_drvdata(hdev);
        struct hyperv_drm_device *hv = to_hv(dev);
@@ -176,8 +176,6 @@ static int hyperv_vmbus_remove(struct hv_device *hdev)
        hv_set_drvdata(hdev, NULL);
 
        vmbus_free_mmio(hv->mem->start, hv->fb_size);
-
-       return 0;
 }
 
 static int hyperv_vmbus_suspend(struct hv_device *hdev)
index cf12f17e65336db4e2dccfac8f5db38d0c80e00a..2a0aabd50a452b00c27656ea79b90b4b35f63c0f 100644 (file)
@@ -524,7 +524,7 @@ probe_err0:
 }
 
 
-static int mousevsc_remove(struct hv_device *dev)
+static void mousevsc_remove(struct hv_device *dev)
 {
        struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
 
@@ -533,8 +533,6 @@ static int mousevsc_remove(struct hv_device *dev)
        hid_hw_stop(input_dev->hid_device);
        hid_destroy_device(input_dev->hid_device);
        mousevsc_free_device(input_dev);
-
-       return 0;
 }
 
 static int mousevsc_suspend(struct hv_device *dev)
index cbe43e2567a7fb496a16899eece9a1efc6d2d5cc..0d4b8fc47ac6d917c7508d748831a79c3d0e520c 100644 (file)
@@ -2042,7 +2042,7 @@ connect_error:
        return ret;
 }
 
-static int balloon_remove(struct hv_device *dev)
+static void balloon_remove(struct hv_device *dev)
 {
        struct hv_dynmem_device *dm = hv_get_drvdata(dev);
        struct hv_hotadd_state *has, *tmp;
@@ -2083,8 +2083,6 @@ static int balloon_remove(struct hv_device *dev)
                kfree(has);
        }
        spin_unlock_irqrestore(&dm_device.ha_lock, flags);
-
-       return 0;
 }
 
 static int balloon_suspend(struct hv_device *hv_dev)
index d776074b49cb46c113d4a8074b7b0e0b775868db..42aec2c5606af756cc89c88cd50d158a733d784e 100644 (file)
@@ -602,7 +602,7 @@ error1:
        return ret;
 }
 
-static int util_remove(struct hv_device *dev)
+static void util_remove(struct hv_device *dev)
 {
        struct hv_util_service *srv = hv_get_drvdata(dev);
 
@@ -610,8 +610,6 @@ static int util_remove(struct hv_device *dev)
                srv->util_deinit();
        vmbus_close(dev->channel);
        kfree(srv->recv_buffer);
-
-       return 0;
 }
 
 /*
index d62aefb2e24515501fb8a5ac1de751ed671d58f9..31def6ce515726618cf11961e53facb278098eeb 100644 (file)
@@ -369,7 +369,7 @@ err_free_mem:
        return error;
 }
 
-static int hv_kbd_remove(struct hv_device *hv_dev)
+static void hv_kbd_remove(struct hv_device *hv_dev)
 {
        struct hv_kbd_dev *kbd_dev = hv_get_drvdata(hv_dev);
 
@@ -378,8 +378,6 @@ static int hv_kbd_remove(struct hv_device *hv_dev)
        kfree(kbd_dev);
 
        hv_set_drvdata(hv_dev, NULL);
-
-       return 0;
 }
 
 static int hv_kbd_suspend(struct hv_device *hv_dev)
index f9b219e6cd58b69a175294d01ac41f4ab7e03404..42162167b5b41142a14b20219203a61f2ae20b71 100644 (file)
@@ -2594,7 +2594,7 @@ no_net:
        return ret;
 }
 
-static int netvsc_remove(struct hv_device *dev)
+static void netvsc_remove(struct hv_device *dev)
 {
        struct net_device_context *ndev_ctx;
        struct net_device *vf_netdev, *net;
@@ -2603,7 +2603,7 @@ static int netvsc_remove(struct hv_device *dev)
        net = hv_get_drvdata(dev);
        if (net == NULL) {
                dev_err(&dev->device, "No net device to remove\n");
-               return 0;
+               return;
        }
 
        ndev_ctx = netdev_priv(net);
@@ -2637,7 +2637,6 @@ static int netvsc_remove(struct hv_device *dev)
 
        free_percpu(ndev_ctx->vf_stats);
        free_netdev(net);
-       return 0;
 }
 
 static int netvsc_suspend(struct hv_device *dev)
index 084f5313895cd0a6953cb37a40e8487c4ce7025d..f33370b7562830bdc73660104be449a14170798e 100644 (file)
@@ -3800,13 +3800,10 @@ static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs)
 /**
  * hv_pci_remove() - Remove routine for this VMBus channel
  * @hdev:      VMBus's tracking struct for this root PCI bus
- *
- * Return: 0 on success, -errno on failure
  */
-static int hv_pci_remove(struct hv_device *hdev)
+static void hv_pci_remove(struct hv_device *hdev)
 {
        struct hv_pcibus_device *hbus;
-       int ret;
 
        hbus = hv_get_drvdata(hdev);
        if (hbus->state == hv_pcibus_installed) {
@@ -3829,7 +3826,7 @@ static int hv_pci_remove(struct hv_device *hdev)
                pci_unlock_rescan_remove();
        }
 
-       ret = hv_pci_bus_exit(hdev, false);
+       hv_pci_bus_exit(hdev, false);
 
        vmbus_close(hdev->channel);
 
@@ -3842,7 +3839,6 @@ static int hv_pci_remove(struct hv_device *hdev)
        hv_put_dom_num(hbus->bridge->domain_nr);
 
        kfree(hbus);
-       return ret;
 }
 
 static int hv_pci_suspend(struct hv_device *hdev)
index d7a84c0bfaeb73570523b95f6bb4ea82a4d06b66..80980b2e4ccb495620d6057ce87b35fbdc643e1f 100644 (file)
@@ -2092,7 +2092,7 @@ static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth)
        return scsi_change_queue_depth(sdev, queue_depth);
 }
 
-static int storvsc_remove(struct hv_device *dev)
+static void storvsc_remove(struct hv_device *dev)
 {
        struct storvsc_device *stor_device = hv_get_drvdata(dev);
        struct Scsi_Host *host = stor_device->host;
@@ -2108,8 +2108,6 @@ static int storvsc_remove(struct hv_device *dev)
        scsi_remove_host(host);
        storvsc_dev_remove(dev);
        scsi_host_put(host);
-
-       return 0;
 }
 
 static int storvsc_suspend(struct hv_device *hv_dev)
index c08a6cfd119f2d4030840eea2ee1e02d1360c191..20d9762331bd767aa88c7b04d3f4c2e84ff72648 100644 (file)
@@ -355,20 +355,19 @@ fail_free_ring:
        return ret;
 }
 
-static int
+static void
 hv_uio_remove(struct hv_device *dev)
 {
        struct hv_uio_private_data *pdata = hv_get_drvdata(dev);
 
        if (!pdata)
-               return 0;
+               return;
 
        sysfs_remove_bin_file(&dev->channel->kobj, &ring_buffer_bin_attr);
        uio_unregister_device(&pdata->info);
        hv_uio_cleanup(dev, pdata);
 
        vmbus_free_ring(dev->channel);
-       return 0;
 }
 
 static struct hv_driver hv_uio_drv = {
index fdbf02b42723c00a377e9ebcf9c11b7a359d4a63..a7f79f51f40ce1fb4e9aeda32a4caec6dc6a50c7 100644 (file)
@@ -1239,8 +1239,7 @@ error1:
        return ret;
 }
 
-
-static int hvfb_remove(struct hv_device *hdev)
+static void hvfb_remove(struct hv_device *hdev)
 {
        struct fb_info *info = hv_get_drvdata(hdev);
        struct hvfb_par *par = info->par;
@@ -1261,8 +1260,6 @@ static int hvfb_remove(struct hv_device *hdev)
 
        hvfb_putmem(hdev, info);
        framebuffer_release(info);
-
-       return 0;
 }
 
 static int hvfb_suspend(struct hv_device *hdev)
index 85f7c5a63aa65f1b2ba14d18082af1f56ed3bed4..cd5cb9f6fae04599538cdc41a90bf6340df06d3e 100644 (file)
@@ -1273,7 +1273,7 @@ struct hv_driver {
        } dynids;
 
        int (*probe)(struct hv_device *, const struct hv_vmbus_device_id *);
-       int (*remove)(struct hv_device *);
+       void (*remove)(struct hv_device *dev);
        void (*shutdown)(struct hv_device *);
 
        int (*suspend)(struct hv_device *);
index 59c3e2697069045ae1227f0ea1d1064823148517..7cb1a9d2cdb4f8bf669c15a5227acfaca5f11c45 100644 (file)
@@ -879,13 +879,11 @@ static int hvs_probe(struct hv_device *hdev,
        return 0;
 }
 
-static int hvs_remove(struct hv_device *hdev)
+static void hvs_remove(struct hv_device *hdev)
 {
        struct vmbus_channel *chan = hdev->channel;
 
        vmbus_close(chan);
-
-       return 0;
 }
 
 /* hv_sock connections can not persist across hibernation, and all the hv_sock