Commit 67c21fc8 authored by Fabio Estevam's avatar Fabio Estevam Committed by Felipe Balbi

usb: phy: phy-mxs-usb: Check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.
Acked-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 9510ecee
No related merge requests found
...@@ -63,9 +63,13 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) ...@@ -63,9 +63,13 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
static int mxs_phy_init(struct usb_phy *phy) static int mxs_phy_init(struct usb_phy *phy)
{ {
int ret;
struct mxs_phy *mxs_phy = to_mxs_phy(phy); struct mxs_phy *mxs_phy = to_mxs_phy(phy);
clk_prepare_enable(mxs_phy->clk); ret = clk_prepare_enable(mxs_phy->clk);
if (ret)
return ret;
return mxs_phy_hw_init(mxs_phy); return mxs_phy_hw_init(mxs_phy);
} }
...@@ -81,6 +85,7 @@ static void mxs_phy_shutdown(struct usb_phy *phy) ...@@ -81,6 +85,7 @@ static void mxs_phy_shutdown(struct usb_phy *phy)
static int mxs_phy_suspend(struct usb_phy *x, int suspend) static int mxs_phy_suspend(struct usb_phy *x, int suspend)
{ {
int ret;
struct mxs_phy *mxs_phy = to_mxs_phy(x); struct mxs_phy *mxs_phy = to_mxs_phy(x);
if (suspend) { if (suspend) {
...@@ -89,7 +94,9 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend) ...@@ -89,7 +94,9 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend)
x->io_priv + HW_USBPHY_CTRL_SET); x->io_priv + HW_USBPHY_CTRL_SET);
clk_disable_unprepare(mxs_phy->clk); clk_disable_unprepare(mxs_phy->clk);
} else { } else {
clk_prepare_enable(mxs_phy->clk); ret = clk_prepare_enable(mxs_phy->clk);
if (ret)
return ret;
writel(BM_USBPHY_CTRL_CLKGATE, writel(BM_USBPHY_CTRL_CLKGATE,
x->io_priv + HW_USBPHY_CTRL_CLR); x->io_priv + HW_USBPHY_CTRL_CLR);
writel(0, x->io_priv + HW_USBPHY_PWD); writel(0, x->io_priv + HW_USBPHY_PWD);
......
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