diff mbox series

[v1,net-next,4/5] ptp_ocp: do not call pci_set_drvdata(pdev, NULL)

Message ID 20220608120358.81147-5-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series ptp_ocp: set of small cleanups | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andy Shevchenko June 8, 2022, 12:03 p.m. UTC
Cleaning up driver data is actually already handled by driver core,
so there is no need to do it manually.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/ptp/ptp_ocp.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Vadim Fedorenko June 8, 2022, 9:47 p.m. UTC | #1
On 08.06.2022 13:03, Andy Shevchenko wrote:
> Cleaning up driver data is actually already handled by driver core,
> so there is no need to do it manually.

I found a couple of places with exactly the same code in error path.
For example Marvell's OcteonX drivers in crypto and net subsystems.
Should we fix them too?

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Overall looks good.

Acked-by: Vadim Fedorenko <vfedorenko@novek.ru>

> ---
>   drivers/ptp/ptp_ocp.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 4e237f806085..857e35c68a04 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -3769,7 +3769,6 @@ ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>   
>   out:
>   	ptp_ocp_detach(bp);
> -	pci_set_drvdata(pdev, NULL);
>   out_disable:
>   	pci_disable_device(pdev);
>   out_free:
> @@ -3785,7 +3784,6 @@ ptp_ocp_remove(struct pci_dev *pdev)
>   
>   	devlink_unregister(devlink);
>   	ptp_ocp_detach(bp);
> -	pci_set_drvdata(pdev, NULL);
>   	pci_disable_device(pdev);
>   
>   	devlink_free(devlink);
Andy Shevchenko June 9, 2022, 10:43 a.m. UTC | #2
On Thu, Jun 9, 2022 at 12:01 AM Vadim Fedorenko <vfedorenko@novek.ru> wrote:
>
> On 08.06.2022 13:03, Andy Shevchenko wrote:
> > Cleaning up driver data is actually already handled by driver core,
> > so there is no need to do it manually.
>
> I found a couple of places with exactly the same code in error path.
> For example Marvell's OcteonX drivers in crypto and net subsystems.
> Should we fix them too?

I believe there are even more, but feel free to fix them, they are not my POI.

...

> Overall looks good.
>
> Acked-by: Vadim Fedorenko <vfedorenko@novek.ru>

Thanks!
diff mbox series

Patch

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 4e237f806085..857e35c68a04 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -3769,7 +3769,6 @@  ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 out:
 	ptp_ocp_detach(bp);
-	pci_set_drvdata(pdev, NULL);
 out_disable:
 	pci_disable_device(pdev);
 out_free:
@@ -3785,7 +3784,6 @@  ptp_ocp_remove(struct pci_dev *pdev)
 
 	devlink_unregister(devlink);
 	ptp_ocp_detach(bp);
-	pci_set_drvdata(pdev, NULL);
 	pci_disable_device(pdev);
 
 	devlink_free(devlink);