diff mbox series

[-next] usb: dwc3: remove unnecessary platform_set_drvdata()

Message ID 20230810134710.114356-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 8d1de0ebce71feb0961458dee7695f1f25767a92
Headers show
Series [-next] usb: dwc3: remove unnecessary platform_set_drvdata() | expand

Commit Message

Yang Yingliang Aug. 10, 2023, 1:47 p.m. UTC
Remove unnecessary platform_set_drvdata(..., NULL) in ->remove(),
the driver_data will be cleared in device_unbind_cleanup() after
calling ->remove() in driver call code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/usb/dwc3/dwc3-am62.c     | 2 --
 drivers/usb/dwc3/dwc3-imx8mp.c   | 1 -
 drivers/usb/dwc3/dwc3-keystone.c | 2 --
 drivers/usb/dwc3/dwc3-octeon.c   | 1 -
 4 files changed, 6 deletions(-)

Comments

Thinh Nguyen Aug. 18, 2023, 1:25 a.m. UTC | #1
On Thu, Aug 10, 2023, Yang Yingliang wrote:
> Remove unnecessary platform_set_drvdata(..., NULL) in ->remove(),
> the driver_data will be cleared in device_unbind_cleanup() after
> calling ->remove() in driver call code.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/usb/dwc3/dwc3-am62.c     | 2 --
>  drivers/usb/dwc3/dwc3-imx8mp.c   | 1 -
>  drivers/usb/dwc3/dwc3-keystone.c | 2 --
>  drivers/usb/dwc3/dwc3-octeon.c   | 1 -
>  4 files changed, 6 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 94dcbc443cf2..90a587bc29b7 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -292,8 +292,6 @@ static void dwc3_ti_remove(struct platform_device *pdev)
>  	clk_disable_unprepare(am62->usb2_refclk);
>  	pm_runtime_disable(dev);
>  	pm_runtime_set_suspended(dev);
> -
> -	platform_set_drvdata(pdev, NULL);
>  }
>  
>  #ifdef CONFIG_PM
> diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
> index 4285bde58d2e..a1e15f2fffdb 100644
> --- a/drivers/usb/dwc3/dwc3-imx8mp.c
> +++ b/drivers/usb/dwc3/dwc3-imx8mp.c
> @@ -280,7 +280,6 @@ static void dwc3_imx8mp_remove(struct platform_device *pdev)
>  
>  	pm_runtime_disable(dev);
>  	pm_runtime_put_noidle(dev);
> -	platform_set_drvdata(pdev, NULL);
>  }
>  
>  static int __maybe_unused dwc3_imx8mp_suspend(struct dwc3_imx8mp *dwc3_imx,
> diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
> index 4155e8d5a559..8899348b6276 100644
> --- a/drivers/usb/dwc3/dwc3-keystone.c
> +++ b/drivers/usb/dwc3/dwc3-keystone.c
> @@ -197,8 +197,6 @@ static void kdwc3_remove(struct platform_device *pdev)
>  	phy_power_off(kdwc->usb3_phy);
>  	phy_exit(kdwc->usb3_phy);
>  	phy_pm_runtime_put_sync(kdwc->usb3_phy);
> -
> -	platform_set_drvdata(pdev, NULL);
>  }
>  
>  static const struct of_device_id kdwc3_of_match[] = {
> diff --git a/drivers/usb/dwc3/dwc3-octeon.c b/drivers/usb/dwc3/dwc3-octeon.c
> index 6b6581057345..356347780c15 100644
> --- a/drivers/usb/dwc3/dwc3-octeon.c
> +++ b/drivers/usb/dwc3/dwc3-octeon.c
> @@ -517,7 +517,6 @@ static void dwc3_octeon_remove(struct platform_device *pdev)
>  	struct dwc3_octeon *octeon = platform_get_drvdata(pdev);
>  
>  	of_platform_depopulate(octeon->dev);
> -	platform_set_drvdata(pdev, NULL);
>  }
>  
>  static const struct of_device_id dwc3_octeon_of_match[] = {
> -- 
> 2.25.1
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 94dcbc443cf2..90a587bc29b7 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -292,8 +292,6 @@  static void dwc3_ti_remove(struct platform_device *pdev)
 	clk_disable_unprepare(am62->usb2_refclk);
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
-
-	platform_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
index 4285bde58d2e..a1e15f2fffdb 100644
--- a/drivers/usb/dwc3/dwc3-imx8mp.c
+++ b/drivers/usb/dwc3/dwc3-imx8mp.c
@@ -280,7 +280,6 @@  static void dwc3_imx8mp_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(dev);
 	pm_runtime_put_noidle(dev);
-	platform_set_drvdata(pdev, NULL);
 }
 
 static int __maybe_unused dwc3_imx8mp_suspend(struct dwc3_imx8mp *dwc3_imx,
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
index 4155e8d5a559..8899348b6276 100644
--- a/drivers/usb/dwc3/dwc3-keystone.c
+++ b/drivers/usb/dwc3/dwc3-keystone.c
@@ -197,8 +197,6 @@  static void kdwc3_remove(struct platform_device *pdev)
 	phy_power_off(kdwc->usb3_phy);
 	phy_exit(kdwc->usb3_phy);
 	phy_pm_runtime_put_sync(kdwc->usb3_phy);
-
-	platform_set_drvdata(pdev, NULL);
 }
 
 static const struct of_device_id kdwc3_of_match[] = {
diff --git a/drivers/usb/dwc3/dwc3-octeon.c b/drivers/usb/dwc3/dwc3-octeon.c
index 6b6581057345..356347780c15 100644
--- a/drivers/usb/dwc3/dwc3-octeon.c
+++ b/drivers/usb/dwc3/dwc3-octeon.c
@@ -517,7 +517,6 @@  static void dwc3_octeon_remove(struct platform_device *pdev)
 	struct dwc3_octeon *octeon = platform_get_drvdata(pdev);
 
 	of_platform_depopulate(octeon->dev);
-	platform_set_drvdata(pdev, NULL);
 }
 
 static const struct of_device_id dwc3_octeon_of_match[] = {