staging: unisys: visorbus: Remove unnecessary dev_set_drvdata()
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Thu, 25 Feb 2016 05:37:59 +0000 (11:07 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Feb 2016 06:41:48 +0000 (22:41 -0800)
Unnecessary dev_set_drvdata() has been removed since the driver
core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device
driver data to NULL.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
struct device *dev;
@@
- dev_set_drvdata(dev, NULL);
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c

index 4f7d74326e593b48de1bdb451a51ea796ace2079..9e048e9a40f01aef9bef1a06765836d912c65400 100644 (file)
@@ -221,7 +221,6 @@ visorbus_release_busdevice(struct device *xdev)
 {
        struct visor_device *dev = dev_get_drvdata(xdev);
 
-       dev_set_drvdata(xdev, NULL);
        kfree(dev);
 }