diff options
author | Emil Renner Berthing <emil.renner.berthing@canonical.com> | 2023-07-22 17:18:24 +0300 |
---|---|---|
committer | Emil Renner Berthing <emil.renner.berthing@canonical.com> | 2024-05-28 13:42:33 +0300 |
commit | 77568ee373a62d4193f2bd74a1ead5a0cd2f887c (patch) | |
tree | d36bc38074b1b6a9dfe5715a8cecedeaaf3b24d7 /drivers/usb | |
parent | 630ef736a2bf9387d5dccf63a77a1c62a72647dd (diff) | |
download | linux-77568ee373a62d4193f2bd74a1ead5a0cd2f887c.tar.xz |
usb: cdns3: starfive: Don't store device backpointer
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/cdns3/cdns3-starfive.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/usb/cdns3/cdns3-starfive.c b/drivers/usb/cdns3/cdns3-starfive.c index dc941dbae723..74a1238176ea 100644 --- a/drivers/usb/cdns3/cdns3-starfive.c +++ b/drivers/usb/cdns3/cdns3-starfive.c @@ -33,7 +33,6 @@ #define USB_REFCLK_MODE BIT(23) struct cdns_starfive { - struct device *dev; struct reset_control *resets; struct clk_bulk_data *clks; int num_clks; @@ -49,7 +48,7 @@ static int cdns_mode_init(struct device *dev, struct cdns_starfive *data) "starfive,stg-syscon", 1, &usb_mode); if (IS_ERR(syscon)) return dev_err_probe(dev, PTR_ERR(syscon), - "Failed to parse starfive,stg-syscon\n"); + "failed to parse starfive,stg-syscon\n"); regmap_update_bits(syscon, usb_mode, USB_MISC_CFG_MASK, @@ -75,18 +74,17 @@ static int cdns_mode_init(struct device *dev, struct cdns_starfive *data) return 0; } -static int cdns_clk_rst_init(struct cdns_starfive *data) +static int cdns_clk_rst_init(struct device *dev, struct cdns_starfive *data) { int ret; ret = clk_bulk_prepare_enable(data->num_clks, data->clks); if (ret) - return dev_err_probe(data->dev, ret, - "failed to enable clocks\n"); + return dev_err_probe(dev, ret, "failed to enable clocks\n"); ret = reset_control_deassert(data->resets); if (ret) { - dev_err(data->dev, "failed to reset clocks\n"); + dev_err(dev, "failed to reset clocks\n"); goto err_clk_init; } @@ -97,7 +95,7 @@ err_clk_init: return ret; } -static void cdns_clk_rst_deinit(struct cdns_starfive *data) +static void cdns_clk_rst_deinit(struct device *dev, struct cdns_starfive *data) { reset_control_assert(data->resets); clk_bulk_disable_unprepare(data->num_clks, data->clks); @@ -113,31 +111,26 @@ static int cdns_starfive_probe(struct platform_device *pdev) if (!data) return -ENOMEM; - data->dev = dev; - - data->num_clks = devm_clk_bulk_get_all(data->dev, &data->clks); + data->num_clks = devm_clk_bulk_get_all(dev, &data->clks); if (data->num_clks < 0) - return dev_err_probe(data->dev, -ENODEV, - "Failed to get clocks\n"); + return dev_err_probe(dev, -ENODEV, "failed to get clocks\n"); - data->resets = devm_reset_control_array_get_exclusive(data->dev); + data->resets = devm_reset_control_array_get_exclusive(dev); if (IS_ERR(data->resets)) - return dev_err_probe(data->dev, PTR_ERR(data->resets), - "Failed to get resets"); + return dev_err_probe(dev, PTR_ERR(data->resets), "failed to get resets\n"); ret = cdns_mode_init(dev, data); if (ret) return ret; - ret = cdns_clk_rst_init(data); + ret = cdns_clk_rst_init(dev, data); if (ret) return ret; ret = of_platform_populate(dev->of_node, NULL, NULL, dev); if (ret) { - dev_err(dev, "Failed to create children\n"); - cdns_clk_rst_deinit(data); - return ret; + cdns_clk_rst_deinit(dev, data); + return dev_err_probe(dev, ret, "failed to create children\n"); } device_set_wakeup_capable(dev, true); @@ -167,7 +160,7 @@ static void cdns_starfive_remove(struct platform_device *pdev) pm_runtime_disable(dev); pm_runtime_put_noidle(dev); - cdns_clk_rst_deinit(data); + cdns_clk_rst_deinit(dev, data); platform_set_drvdata(pdev, NULL); } @@ -193,14 +186,14 @@ static int cdns_starfive_resume(struct device *dev) { struct cdns_starfive *data = dev_get_drvdata(dev); - return cdns_clk_rst_init(data); + return cdns_clk_rst_init(dev, data); } static int cdns_starfive_suspend(struct device *dev) { struct cdns_starfive *data = dev_get_drvdata(dev); - cdns_clk_rst_deinit(data); + cdns_clk_rst_deinit(dev, data); return 0; } |