diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2016-08-23 03:45:36 +0200 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-09-05 12:39:23 +0200 |
commit | 7c113f7df710df2aed63709815e518608dbd338c (patch) | |
tree | 8f796be14df11f2fd7fca795f7594edbba3e830c /drivers/usb/phy/phy-generic.c | |
parent | usb: gadget: udc: renesas-usb3: clear VBOUT bit in DRD_CON (diff) | |
download | linux-7c113f7df710df2aed63709815e518608dbd338c.tar.xz linux-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>
Diffstat (limited to 'drivers/usb/phy/phy-generic.c')
-rw-r--r-- | drivers/usb/phy/phy-generic.c | 8 |
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); |