2013-11-25 01:49:55

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 1/3] wireless: ipw2100: remove unnecessary pci_set_drvdata()

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.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index f8ab193..2f4233a 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6362,7 +6362,6 @@ out:
&ipw2100_attribute_group);

free_libipw(dev, 0);
- pci_set_drvdata(pci_dev, NULL);
}

pci_iounmap(pci_dev, ioaddr);
--
1.7.10.4




2013-11-26 06:55:28

by Stanislav Yakovlev

[permalink] [raw]
Subject: Re: [PATCH 1/3] wireless: ipw2100: remove unnecessary pci_set_drvdata()

Hello Jingoo,

On 24 November 2013 17:49, Jingoo Han <[email protected]> wrote:
> 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.
>
> Signed-off-by: Jingoo Han <[email protected]>
> ---

Looks fine, thanks.


Stanislav.

2013-11-25 01:52:41

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 3/3] wireless: rt2x00: remove unnecessary pci_set_drvdata()

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.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/net/wireless/rt2x00/rt2x00pci.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 25da20e..af72183 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -156,8 +156,6 @@ exit_release_regions:
exit_disable_device:
pci_disable_device(pci_dev);

- pci_set_drvdata(pci_dev, NULL);
-
return retval;
}
EXPORT_SYMBOL_GPL(rt2x00pci_probe);
@@ -177,7 +175,6 @@ void rt2x00pci_remove(struct pci_dev *pci_dev)
/*
* Free the PCI device data.
*/
- pci_set_drvdata(pci_dev, NULL);
pci_disable_device(pci_dev);
pci_release_regions(pci_dev);
}
--
1.7.10.4



2013-11-25 01:51:11

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 2/3] wireless: prism54: remove unnecessary pci_set_drvdata()

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.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/net/wireless/prism54/islpci_dev.c | 1 -
drivers/net/wireless/prism54/islpci_hotplug.c | 2 --
2 files changed, 3 deletions(-)

diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
index e05d9b4..7fa2898 100644
--- a/drivers/net/wireless/prism54/islpci_dev.c
+++ b/drivers/net/wireless/prism54/islpci_dev.c
@@ -914,7 +914,6 @@ islpci_setup(struct pci_dev *pdev)
do_islpci_free_memory:
islpci_free_memory(priv);
do_free_netdev:
- pci_set_drvdata(pdev, NULL);
free_netdev(ndev);
priv = NULL;
return NULL;
diff --git a/drivers/net/wireless/prism54/islpci_hotplug.c b/drivers/net/wireless/prism54/islpci_hotplug.c
index 9e68e0c..d7b9e63 100644
--- a/drivers/net/wireless/prism54/islpci_hotplug.c
+++ b/drivers/net/wireless/prism54/islpci_hotplug.c
@@ -199,7 +199,6 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
do_unregister_netdev:
unregister_netdev(ndev);
islpci_free_memory(priv);
- pci_set_drvdata(pdev, NULL);
free_netdev(ndev);
priv = NULL;
do_pci_clear_mwi:
@@ -247,7 +246,6 @@ prism54_remove(struct pci_dev *pdev)
/* free the PCI memory and unmap the remapped page */
islpci_free_memory(priv);

- pci_set_drvdata(pdev, NULL);
free_netdev(ndev);
priv = NULL;

--
1.7.10.4



2013-11-25 14:15:01

by Gertjan van Wingerde

[permalink] [raw]
Subject: Re: [PATCH 3/3] wireless: rt2x00: remove unnecessary pci_set_drvdata()

On Mon, Nov 25, 2013 at 2:52 AM, Jingoo Han <[email protected]> wrote:
> 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.
>
> Signed-off-by: Jingoo Han <[email protected]>

Acked-by: Gertjan van Wingerde <[email protected]>

> ---
> drivers/net/wireless/rt2x00/rt2x00pci.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
> index 25da20e..af72183 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
> @@ -156,8 +156,6 @@ exit_release_regions:
> exit_disable_device:
> pci_disable_device(pci_dev);
>
> - pci_set_drvdata(pci_dev, NULL);
> -
> return retval;
> }
> EXPORT_SYMBOL_GPL(rt2x00pci_probe);
> @@ -177,7 +175,6 @@ void rt2x00pci_remove(struct pci_dev *pci_dev)
> /*
> * Free the PCI device data.
> */
> - pci_set_drvdata(pci_dev, NULL);
> pci_disable_device(pci_dev);
> pci_release_regions(pci_dev);
> }
> --
> 1.7.10.4
>
>



--
---
Gertjan