There is no need to keep a local 'phy_np' as we can directly use the private
structure in data->phy_np.

Signed-off-by: Fabio Estevam <fabio.este...@freescale.com>
---
 drivers/usb/chipidea/ci13xxx_imx.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/chipidea/ci13xxx_imx.c 
b/drivers/usb/chipidea/ci13xxx_imx.c
index 8b2d6cf..0810a19 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -100,7 +100,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
 {
        struct ci13xxx_imx_data *data;
        struct platform_device *phy_pdev;
-       struct device_node *phy_np;
        struct resource *res;
        struct pinctrl *pinctrl;
        int ret;
@@ -140,10 +139,9 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
                return ret;
        }
 
-       phy_np = of_parse_phandle(pdev->dev.of_node, "fsl,usbphy", 0);
-       if (phy_np) {
-               data->phy_np = phy_np;
-               phy_pdev = of_find_device_by_node(phy_np);
+       data->phy_np = of_parse_phandle(pdev->dev.of_node, "fsl,usbphy", 0);
+       if (data->phy_np) {
+               phy_pdev = of_find_device_by_node(data->phy_np);
                if (phy_pdev) {
                        struct usb_phy *phy;
                        phy = pdev_to_phy(phy_pdev);
@@ -218,8 +216,8 @@ err:
        if (data->reg_vbus)
                regulator_disable(data->reg_vbus);
 put_np:
-       if (phy_np)
-               of_node_put(phy_np);
+       if (data->phy_np)
+               of_node_put(data->phy_np);
        clk_disable_unprepare(data->clk);
        return ret;
 }
-- 
1.8.1.2


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to