Commit 045ef311 authored by Vivek Gautam's avatar Vivek Gautam Committed by Kishon Vijay Abraham I

phy: Fix ptr_ret.cocci warnings

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.

Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: default avatarVivek Gautam <vivek.gautam@codeaurora.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 0e65ba28
...@@ -537,10 +537,7 @@ static int ti_pipe3_get_pll_base(struct ti_pipe3 *phy) ...@@ -537,10 +537,7 @@ static int ti_pipe3_get_pll_base(struct ti_pipe3 *phy)
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"pll_ctrl"); "pll_ctrl");
phy->pll_ctrl_base = devm_ioremap_resource(dev, res); phy->pll_ctrl_base = devm_ioremap_resource(dev, res);
if (IS_ERR(phy->pll_ctrl_base)) return PTR_ERR_OR_ZERO(phy->pll_ctrl_base);
return PTR_ERR(phy->pll_ctrl_base);
return 0;
} }
static int ti_pipe3_probe(struct platform_device *pdev) static int ti_pipe3_probe(struct platform_device *pdev)
...@@ -592,10 +589,7 @@ static int ti_pipe3_probe(struct platform_device *pdev) ...@@ -592,10 +589,7 @@ static int ti_pipe3_probe(struct platform_device *pdev)
ti_pipe3_power_off(generic_phy); ti_pipe3_power_off(generic_phy);
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
if (IS_ERR(phy_provider)) return PTR_ERR_OR_ZERO(phy_provider);
return PTR_ERR(phy_provider);
return 0;
} }
static int ti_pipe3_remove(struct platform_device *pdev) static int ti_pipe3_remove(struct platform_device *pdev)
......
...@@ -561,10 +561,7 @@ static int tegra_xusb_usb2_port_parse_dt(struct tegra_xusb_usb2_port *usb2) ...@@ -561,10 +561,7 @@ static int tegra_xusb_usb2_port_parse_dt(struct tegra_xusb_usb2_port *usb2)
usb2->internal = of_property_read_bool(np, "nvidia,internal"); usb2->internal = of_property_read_bool(np, "nvidia,internal");
usb2->supply = devm_regulator_get(&port->dev, "vbus"); usb2->supply = devm_regulator_get(&port->dev, "vbus");
if (IS_ERR(usb2->supply)) return PTR_ERR_OR_ZERO(usb2->supply);
return PTR_ERR(usb2->supply);
return 0;
} }
static int tegra_xusb_add_usb2_port(struct tegra_xusb_padctl *padctl, static int tegra_xusb_add_usb2_port(struct tegra_xusb_padctl *padctl,
...@@ -731,10 +728,7 @@ static int tegra_xusb_usb3_port_parse_dt(struct tegra_xusb_usb3_port *usb3) ...@@ -731,10 +728,7 @@ static int tegra_xusb_usb3_port_parse_dt(struct tegra_xusb_usb3_port *usb3)
usb3->internal = of_property_read_bool(np, "nvidia,internal"); usb3->internal = of_property_read_bool(np, "nvidia,internal");
usb3->supply = devm_regulator_get(&port->dev, "vbus"); usb3->supply = devm_regulator_get(&port->dev, "vbus");
if (IS_ERR(usb3->supply)) return PTR_ERR_OR_ZERO(usb3->supply);
return PTR_ERR(usb3->supply);
return 0;
} }
static int tegra_xusb_add_usb3_port(struct tegra_xusb_padctl *padctl, static int tegra_xusb_add_usb3_port(struct tegra_xusb_padctl *padctl,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment