summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2016-08-22 22:45:36 -0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-09-05 13:39:23 +0300
commit7c113f7df710df2aed63709815e518608dbd338c (patch)
tree8f796be14df11f2fd7fca795f7594edbba3e830c
parentb2f1eaaee564c5593c303f4d15d827924cb6d20d (diff)
downloadlinux-stable-7c113f7df710df2aed63709815e518608dbd338c.tar.gz
linux-stable-7c113f7df710df2aed63709815e518608dbd338c.tar.bz2
linux-stable-7c113f7df710df2aed63709815e518608dbd338c.zip
usb: phy: phy-generic: Check clk_prepare_enable() error
clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of failure. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/phy/phy-generic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index 980c9dee09eb..427efb5eebae 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -144,14 +144,18 @@ static irqreturn_t nop_gpio_vbus_thread(int irq, void *data)
int usb_gen_phy_init(struct usb_phy *phy)
{
struct usb_phy_generic *nop = dev_get_drvdata(phy->dev);
+ int ret;
if (!IS_ERR(nop->vcc)) {
if (regulator_enable(nop->vcc))
dev_err(phy->dev, "Failed to enable power\n");
}
- if (!IS_ERR(nop->clk))
- clk_prepare_enable(nop->clk);
+ if (!IS_ERR(nop->clk)) {
+ ret = clk_prepare_enable(nop->clk);
+ if (ret)
+ return ret;
+ }
nop_reset(nop);