Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1436767
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 09/10] phy: rockhip-usb: use devm_add_action_or_reset() |
| Date | 2016-07-05 07:30 +0200 |
| Message-ID | <rRr5L-70r-25@gated-at.bofh.it> (permalink) |
| References | <rRr5L-70r-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
If devm_add_action() fails we are explicitly calling the cleanup to free
the resources allocated. Lets use the helper devm_add_action_or_reset()
and return directly in case of error, as we know that the cleanup function
has been already called by the helper if there was any error.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-rockchip-usb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/phy-rockchip-usb.c b/drivers/phy/phy-rockchip-usb.c
index e66b5bf..2a7381f 100644
--- a/drivers/phy/phy-rockchip-usb.c
+++ b/drivers/phy/phy-rockchip-usb.c
@@ -236,9 +236,10 @@ static int rockchip_usb_phy_init(struct rockchip_usb_phy_base *base,
goto err_clk_prov;
}
- err = devm_add_action(base->dev, rockchip_usb_phy_action, rk_phy);
+ err = devm_add_action_or_reset(base->dev, rockchip_usb_phy_action,
+ rk_phy);
if (err)
- goto err_devm_action;
+ return err;
rk_phy->phy = devm_phy_create(base->dev, child, &ops);
if (IS_ERR(rk_phy->phy)) {
@@ -256,9 +257,6 @@ static int rockchip_usb_phy_init(struct rockchip_usb_phy_base *base,
else
return rockchip_usb_phy_power(rk_phy, 1);
-err_devm_action:
- if (!rk_phy->uart_enabled)
- of_clk_del_provider(child);
err_clk_prov:
if (!rk_phy->uart_enabled)
clk_unregister(rk_phy->clk480m);
--
1.7.9.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL] phy: for 4.8 merge window Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 07/10] phy: phy-qcom-ufs-qmp-14nm: Remove site specific OOM error message Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 03/10] dt-bindings: Add bindings for phy-da8xx-usb Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 08/10] phy-sun4i-usb: Add workaround for missing Vbus det interrupts on A31 Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 10/10] phy: rcar-gen3-usb2: fix mutex_lock calling in interrupt Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 04/10] phy: da8xx-usb: new driver for DA8xx SoC USB PHY Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 02/10] phy: Add set_mode callback Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 09/10] phy: rockhip-usb: use devm_add_action_or_reset() Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200 [PATCH 05/10] phy: rockchip-usb: should be a child device of the GRF Kishon Vijay Abraham I <kishon@ti.com> - 2016-07-05 07:30 +0200
csiph-web