summaryrefslogtreecommitdiff
path: root/drivers/usb/chipidea/ci_hdrc_imx.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-11-28 16:06:44 +0800
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 08:47:25 -0500
commit126d0d3a4d6e61eae41c64f624c59dc683af6aff (patch)
tree40608d77be0ecf64b85d2676eec1da5e94c08703 /drivers/usb/chipidea/ci_hdrc_imx.c
parent0645302054cb0807232c8aa2e0740c74f3b574eb (diff)
ENGR00290297 usb: imx6-usb-charger: disable charger if it has not configurated
If the user set imx6-usb-charger-detection at dts, but not enable CONFIG_IMX6_USB_CHARGER, the imx6_usb_create_charger will return -ENODEV, and the controlller probe will fail, it is not we want, what we expect is the charger detection has disabled, but controller function should not be affected. Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'drivers/usb/chipidea/ci_hdrc_imx.c')
-rw-r--r--drivers/usb/chipidea/ci_hdrc_imx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 8994f4b91151..d9a538809e20 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -243,9 +243,10 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
data->charger.dev = &pdev->dev;
ret = imx6_usb_create_charger(&data->charger,
"imx6_usb_charger");
- if (ret)
+ if (ret && ret != -ENODEV)
goto err_clk;
- dev_dbg(&pdev->dev, "USB Charger is created\n");
+ if (!ret)
+ dev_dbg(&pdev->dev, "USB Charger is created\n");
}
data->ci_pdev = ci_hdrc_add_device(&pdev->dev,