Skip to content

Commit 96ec293

Browse files
Dawei Liliuw
authored andcommitted
Drivers: hv: Make remove callback of hyperv driver void returned
Since commit fc7a620 ("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 <[email protected]> Link: https://lore.kernel.org/r/TYCP286MB2323A93C55526E4DF239D3ACCAFA9@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM Signed-off-by: Wei Liu <[email protected]>
1 parent 8536290 commit 96ec293

File tree

12 files changed

+15
-38
lines changed

12 files changed

+15
-38
lines changed

drivers/gpu/drm/hyperv/hyperv_drm_drv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
165165
return ret;
166166
}
167167

168-
static int hyperv_vmbus_remove(struct hv_device *hdev)
168+
static void hyperv_vmbus_remove(struct hv_device *hdev)
169169
{
170170
struct drm_device *dev = hv_get_drvdata(hdev);
171171
struct hyperv_drm_device *hv = to_hv(dev);
@@ -176,8 +176,6 @@ static int hyperv_vmbus_remove(struct hv_device *hdev)
176176
hv_set_drvdata(hdev, NULL);
177177

178178
vmbus_free_mmio(hv->mem->start, hv->fb_size);
179-
180-
return 0;
181179
}
182180

183181
static int hyperv_vmbus_suspend(struct hv_device *hdev)

drivers/hid/hid-hyperv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ static int mousevsc_probe(struct hv_device *device,
524524
}
525525

526526

527-
static int mousevsc_remove(struct hv_device *dev)
527+
static void mousevsc_remove(struct hv_device *dev)
528528
{
529529
struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
530530

@@ -533,8 +533,6 @@ static int mousevsc_remove(struct hv_device *dev)
533533
hid_hw_stop(input_dev->hid_device);
534534
hid_destroy_device(input_dev->hid_device);
535535
mousevsc_free_device(input_dev);
536-
537-
return 0;
538536
}
539537

540538
static int mousevsc_suspend(struct hv_device *dev)

drivers/hv/hv_balloon.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ static int balloon_probe(struct hv_device *dev,
20422042
return ret;
20432043
}
20442044

2045-
static int balloon_remove(struct hv_device *dev)
2045+
static void balloon_remove(struct hv_device *dev)
20462046
{
20472047
struct hv_dynmem_device *dm = hv_get_drvdata(dev);
20482048
struct hv_hotadd_state *has, *tmp;
@@ -2083,8 +2083,6 @@ static int balloon_remove(struct hv_device *dev)
20832083
kfree(has);
20842084
}
20852085
spin_unlock_irqrestore(&dm_device.ha_lock, flags);
2086-
2087-
return 0;
20882086
}
20892087

20902088
static int balloon_suspend(struct hv_device *hv_dev)

drivers/hv/hv_util.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,16 +602,14 @@ static int util_probe(struct hv_device *dev,
602602
return ret;
603603
}
604604

605-
static int util_remove(struct hv_device *dev)
605+
static void util_remove(struct hv_device *dev)
606606
{
607607
struct hv_util_service *srv = hv_get_drvdata(dev);
608608

609609
if (srv->util_deinit)
610610
srv->util_deinit();
611611
vmbus_close(dev->channel);
612612
kfree(srv->recv_buffer);
613-
614-
return 0;
615613
}
616614

617615
/*

drivers/input/serio/hyperv-keyboard.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ static int hv_kbd_probe(struct hv_device *hv_dev,
369369
return error;
370370
}
371371

372-
static int hv_kbd_remove(struct hv_device *hv_dev)
372+
static void hv_kbd_remove(struct hv_device *hv_dev)
373373
{
374374
struct hv_kbd_dev *kbd_dev = hv_get_drvdata(hv_dev);
375375

@@ -378,8 +378,6 @@ static int hv_kbd_remove(struct hv_device *hv_dev)
378378
kfree(kbd_dev);
379379

380380
hv_set_drvdata(hv_dev, NULL);
381-
382-
return 0;
383381
}
384382

385383
static int hv_kbd_suspend(struct hv_device *hv_dev)

drivers/net/hyperv/netvsc_drv.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ static int netvsc_probe(struct hv_device *dev,
25942594
return ret;
25952595
}
25962596

2597-
static int netvsc_remove(struct hv_device *dev)
2597+
static void netvsc_remove(struct hv_device *dev)
25982598
{
25992599
struct net_device_context *ndev_ctx;
26002600
struct net_device *vf_netdev, *net;
@@ -2603,7 +2603,7 @@ static int netvsc_remove(struct hv_device *dev)
26032603
net = hv_get_drvdata(dev);
26042604
if (net == NULL) {
26052605
dev_err(&dev->device, "No net device to remove\n");
2606-
return 0;
2606+
return;
26072607
}
26082608

26092609
ndev_ctx = netdev_priv(net);
@@ -2637,7 +2637,6 @@ static int netvsc_remove(struct hv_device *dev)
26372637

26382638
free_percpu(ndev_ctx->vf_stats);
26392639
free_netdev(net);
2640-
return 0;
26412640
}
26422641

26432642
static int netvsc_suspend(struct hv_device *dev)

drivers/pci/controller/pci-hyperv.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3800,13 +3800,10 @@ static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs)
38003800
/**
38013801
* hv_pci_remove() - Remove routine for this VMBus channel
38023802
* @hdev: VMBus's tracking struct for this root PCI bus
3803-
*
3804-
* Return: 0 on success, -errno on failure
38053803
*/
3806-
static int hv_pci_remove(struct hv_device *hdev)
3804+
static void hv_pci_remove(struct hv_device *hdev)
38073805
{
38083806
struct hv_pcibus_device *hbus;
3809-
int ret;
38103807

38113808
hbus = hv_get_drvdata(hdev);
38123809
if (hbus->state == hv_pcibus_installed) {
@@ -3829,7 +3826,7 @@ static int hv_pci_remove(struct hv_device *hdev)
38293826
pci_unlock_rescan_remove();
38303827
}
38313828

3832-
ret = hv_pci_bus_exit(hdev, false);
3829+
hv_pci_bus_exit(hdev, false);
38333830

38343831
vmbus_close(hdev->channel);
38353832

@@ -3842,7 +3839,6 @@ static int hv_pci_remove(struct hv_device *hdev)
38423839
hv_put_dom_num(hbus->bridge->domain_nr);
38433840

38443841
kfree(hbus);
3845-
return ret;
38463842
}
38473843

38483844
static int hv_pci_suspend(struct hv_device *hdev)

drivers/scsi/storvsc_drv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth)
20922092
return scsi_change_queue_depth(sdev, queue_depth);
20932093
}
20942094

2095-
static int storvsc_remove(struct hv_device *dev)
2095+
static void storvsc_remove(struct hv_device *dev)
20962096
{
20972097
struct storvsc_device *stor_device = hv_get_drvdata(dev);
20982098
struct Scsi_Host *host = stor_device->host;
@@ -2108,8 +2108,6 @@ static int storvsc_remove(struct hv_device *dev)
21082108
scsi_remove_host(host);
21092109
storvsc_dev_remove(dev);
21102110
scsi_host_put(host);
2111-
2112-
return 0;
21132111
}
21142112

21152113
static int storvsc_suspend(struct hv_device *hv_dev)

drivers/uio/uio_hv_generic.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,20 +355,19 @@ hv_uio_probe(struct hv_device *dev,
355355
return ret;
356356
}
357357

358-
static int
358+
static void
359359
hv_uio_remove(struct hv_device *dev)
360360
{
361361
struct hv_uio_private_data *pdata = hv_get_drvdata(dev);
362362

363363
if (!pdata)
364-
return 0;
364+
return;
365365

366366
sysfs_remove_bin_file(&dev->channel->kobj, &ring_buffer_bin_attr);
367367
uio_unregister_device(&pdata->info);
368368
hv_uio_cleanup(dev, pdata);
369369

370370
vmbus_free_ring(dev->channel);
371-
return 0;
372371
}
373372

374373
static struct hv_driver hv_uio_drv = {

drivers/video/fbdev/hyperv_fb.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,8 +1239,7 @@ static int hvfb_probe(struct hv_device *hdev,
12391239
return ret;
12401240
}
12411241

1242-
1243-
static int hvfb_remove(struct hv_device *hdev)
1242+
static void hvfb_remove(struct hv_device *hdev)
12441243
{
12451244
struct fb_info *info = hv_get_drvdata(hdev);
12461245
struct hvfb_par *par = info->par;
@@ -1261,8 +1260,6 @@ static int hvfb_remove(struct hv_device *hdev)
12611260

12621261
hvfb_putmem(hdev, info);
12631262
framebuffer_release(info);
1264-
1265-
return 0;
12661263
}
12671264

12681265
static int hvfb_suspend(struct hv_device *hdev)

0 commit comments

Comments
 (0)