summaryrefslogtreecommitdiff
path: root/drivers/phy/tegra
diff options
context:
space:
mode:
authorVivek Gautam <vivek.gautam@codeaurora.org>2016-10-20 12:23:39 +0530
committerKishon Vijay Abraham I <kishon@ti.com>2016-11-18 18:19:16 +0530
commit045ef3115382fab2c16f2692411296ebfba60256 (patch)
tree51b2b9e12f3012823d2da6eb7a872e23b0e8911b /drivers/phy/tegra
parent0e65ba283eb40b9b2f02ac9517aff0e1f6eb28ea (diff)
downloadlwn-045ef3115382fab2c16f2692411296ebfba60256.tar.gz
lwn-045ef3115382fab2c16f2692411296ebfba60256.zip
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: Vivek Gautam <vivek.gautam@codeaurora.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/tegra')
-rw-r--r--drivers/phy/tegra/xusb.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 873424ab0e32..3cbcb2537657 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -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->supply = devm_regulator_get(&port->dev, "vbus");
- if (IS_ERR(usb2->supply))
- return PTR_ERR(usb2->supply);
-
- return 0;
+ return PTR_ERR_OR_ZERO(usb2->supply);
}
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)
usb3->internal = of_property_read_bool(np, "nvidia,internal");
usb3->supply = devm_regulator_get(&port->dev, "vbus");
- if (IS_ERR(usb3->supply))
- return PTR_ERR(usb3->supply);
-
- return 0;
+ return PTR_ERR_OR_ZERO(usb3->supply);
}
static int tegra_xusb_add_usb3_port(struct tegra_xusb_padctl *padctl,