mfd: timberdale: Remove unnecessary pci_set_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Fri, 13 Sep 2013 02:23:57 +0000 (11:23 +0900)
committerLee Jones <lee.jones@linaro.org>
Wed, 23 Oct 2013 15:20:56 +0000 (16:20 +0100)
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL. It also removes unnecessary label such
as 'err_request'.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/timberdale.c

index a6755ec7bd6ac55a1a8675a2d0382330f6863f54..dbb34f94e5e3fce2e0df7f18097930558069af2f 100644 (file)
@@ -678,7 +678,7 @@ static int timb_probe(struct pci_dev *dev,
        priv->ctl_mapbase = mapbase + CHIPCTLOFFSET;
        if (!request_mem_region(priv->ctl_mapbase, CHIPCTLSIZE, "timb-ctl")) {
                dev_err(&dev->dev, "Failed to request ctl mem\n");
-               goto err_request;
+               goto err_start;
        }
 
        priv->ctl_membase = ioremap(priv->ctl_mapbase, CHIPCTLSIZE);
@@ -828,13 +828,10 @@ err_config:
        iounmap(priv->ctl_membase);
 err_ioremap:
        release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE);
-err_request:
-       pci_set_drvdata(dev, NULL);
 err_start:
        pci_disable_device(dev);
 err_enable:
        kfree(priv);
-       pci_set_drvdata(dev, NULL);
        return -ENODEV;
 }
 
@@ -851,7 +848,6 @@ static void timb_remove(struct pci_dev *dev)
 
        pci_disable_msix(dev);
        pci_disable_device(dev);
-       pci_set_drvdata(dev, NULL);
        kfree(priv);
 }