usb: dwc3: remove unnecessary platform_set_drvdata()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 10 Aug 2023 13:47:10 +0000 (21:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Aug 2023 12:45:19 +0000 (14:45 +0200)
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>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20230810134710.114356-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-am62.c
drivers/usb/dwc3/dwc3-imx8mp.c
drivers/usb/dwc3/dwc3-keystone.c
drivers/usb/dwc3/dwc3-octeon.c

index 94dcbc443cf2287a071b798ad73db6a78a3ca10c..90a587bc29b74e533212f41e1a25fcda9655d68f 100644 (file)
@@ -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
index 4285bde58d2ee35fe1b69fd1add31f200d55fabd..a1e15f2fffdbff6811ff09fbadd681a8967c2f30 100644 (file)
@@ -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,
index 4155e8d5a559acd213cda6b08cc7d68d48565dbe..8899348b627632e647c1762c50106a124ac6eac8 100644 (file)
@@ -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[] = {
index 73bdcebf465c29e54c5b952469b59f1dc4371f63..ff01f2c17452d80c8192b7a7c6bf63470f742870 100644 (file)
@@ -519,7 +519,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[] = {