summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-mxs-usb.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-07-03 16:34:13 -0300
committerFelipe Balbi <balbi@ti.com>2013-07-29 13:56:50 +0300
commit51e563e3c11492748d11d3846b6d325426427a95 (patch)
treee05f07176ed0ace3da35bb27bff73ef3fc3af262 /drivers/usb/phy/phy-mxs-usb.c
parent24dc3538bcfb353741e653fab550c4bf0a8dc07d (diff)
downloadop-kernel-dev-51e563e3c11492748d11d3846b6d325426427a95.zip
op-kernel-dev-51e563e3c11492748d11d3846b6d325426427a95.tar.gz
usb: phy: phy-mxs-usb: Check the return value from stmp_reset_block()
stmp_reset_block() may fail, so let's check its return value and propagate it in the case of error. Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-mxs-usb.c')
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index bd601c5..fdd33b4 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -41,11 +41,14 @@ struct mxs_phy {
#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
-static void mxs_phy_hw_init(struct mxs_phy *mxs_phy)
+static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
{
+ int ret;
void __iomem *base = mxs_phy->phy.io_priv;
- stmp_reset_block(base + HW_USBPHY_CTRL);
+ ret = stmp_reset_block(base + HW_USBPHY_CTRL);
+ if (ret)
+ return ret;
/* Power up the PHY */
writel(0, base + HW_USBPHY_PWD);
@@ -54,6 +57,8 @@ static void mxs_phy_hw_init(struct mxs_phy *mxs_phy)
writel(BM_USBPHY_CTRL_ENUTMILEVEL2 |
BM_USBPHY_CTRL_ENUTMILEVEL3,
base + HW_USBPHY_CTRL_SET);
+
+ return 0;
}
static int mxs_phy_init(struct usb_phy *phy)
@@ -61,9 +66,7 @@ static int mxs_phy_init(struct usb_phy *phy)
struct mxs_phy *mxs_phy = to_mxs_phy(phy);
clk_prepare_enable(mxs_phy->clk);
- mxs_phy_hw_init(mxs_phy);
-
- return 0;
+ return mxs_phy_hw_init(mxs_phy);
}
static void mxs_phy_shutdown(struct usb_phy *phy)
OpenPOWER on IntegriCloud