diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-18 14:42:00 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 23:02:06 (GMT) |
commit | 3eced21a5afbb0f5d4d723d15d25ac9b1b98318c (patch) | |
tree | be27df0a4a387ea589094a97b5e233dd651fea20 | |
parent | bab469cdb6674cdf03b9243663cbbb8326510b41 (diff) | |
download | linux-3eced21a5afbb0f5d4d723d15d25ac9b1b98318c.tar.xz |
staging: most: hdm-dim2: Replace request_irq with devm_request_irq
Devm_ functions allocate memory that is released when a driver
detaches. Replace request_irq with devm_request_irq to get the
interrupt for device which is automatically freed on exit. Remove
corresponding free_irq from probe and remove functions of a platform
device.
Also, remove an unnecessary label.
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/most/hdm-dim2/dim2_hdm.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c b/drivers/staging/most/hdm-dim2/dim2_hdm.c index 708b998..c9cc9c1 100644 --- a/drivers/staging/most/hdm-dim2/dim2_hdm.c +++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c @@ -758,7 +758,8 @@ static int dim2_probe(struct platform_device *pdev) } dev->irq_ahb0 = ret; - ret = request_irq(dev->irq_ahb0, dim2_ahb_isr, 0, "mlb_ahb0", dev); + ret = devm_request_irq(&pdev->dev, dev->irq_ahb0, dim2_ahb_isr, 0, + "mlb_ahb0", dev); if (ret) { pr_err("failed to request IRQ: %d, err: %d\n", dev->irq_ahb0, ret); @@ -769,10 +770,8 @@ static int dim2_probe(struct platform_device *pdev) dev->deliver_netinfo = 0; dev->netinfo_task = kthread_run(&deliver_netinfo_thread, (void *)dev, "dim2_netinfo"); - if (IS_ERR(dev->netinfo_task)) { + if (IS_ERR(dev->netinfo_task)) ret = PTR_ERR(dev->netinfo_task); - goto err_free_irq; - } for (i = 0; i < DMA_CHANNELS; i++) { struct most_channel_capability *cap = dev->capabilities + i; @@ -840,10 +839,6 @@ err_unreg_iface: most_deregister_interface(&dev->most_iface); err_stop_thread: kthread_stop(dev->netinfo_task); -err_free_irq: -#if !defined(ENABLE_HDM_TEST) - free_irq(dev->irq_ahb0, dev); -#endif return ret; } @@ -870,9 +865,6 @@ static int dim2_remove(struct platform_device *pdev) dim2_sysfs_destroy(&dev->bus); most_deregister_interface(&dev->most_iface); kthread_stop(dev->netinfo_task); -#if !defined(ENABLE_HDM_TEST) - free_irq(dev->irq_ahb0, dev); -#endif /* * break link to local platform_device_id struct |