diff options
author | Peter Chen <peter.chen@freescale.com> | 2013-11-28 16:06:44 +0800 |
---|---|---|
committer | Peter Chen <peter.chen@freescale.com> | 2013-11-28 16:32:22 +0800 |
commit | 465aa30deea0cc927186170e63180cb7307366d0 (patch) | |
tree | 477aed695ab066d5d0a8fc7ae5153b315fe06bd8 | |
parent | a0f1e9be214ad6b759fee302f72c1d33e05612e0 (diff) |
ENGR00290034 usb: imx6-usb-charger: disable charger if it is 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.
We are not sure if power supply core will return -ENODEV at some fail
cases, so we use IS_ENABLED(CONFIG_IMX6_USB_CHARGER) to enable
charger function for satety.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 8994f4b91151..0cb2961a54b1 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -228,7 +228,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) } } - if (of_find_property(np, "imx6-usb-charger-detection", NULL)) + if (of_find_property(np, "imx6-usb-charger-detection", NULL) && + IS_ENABLED(CONFIG_IMX6_USB_CHARGER)) data->imx6_usb_charger_detection = true; if (data->imx6_usb_charger_detection) { |