Commit 3f4aad6e authored by Peter Chen's avatar Peter Chen

usb: chipidea: imx: refine the error handling for hsic

- -EPROBE_DEFER is an error, but without need show error message
- If pintrol is not existed, as pintrol is NULL
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
parent 7d5ec335
...@@ -330,8 +330,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) ...@@ -330,8 +330,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
pdata.flags |= CI_HDRC_IMX_IS_HSIC; pdata.flags |= CI_HDRC_IMX_IS_HSIC;
data->usbmisc_data->hsic = 1; data->usbmisc_data->hsic = 1;
data->pinctrl = devm_pinctrl_get(dev); data->pinctrl = devm_pinctrl_get(dev);
if (IS_ERR(data->pinctrl)) { if (PTR_ERR(data->pinctrl) == -ENODEV)
dev_err(dev, "pinctrl get failed, err=%ld\n", data->pinctrl = NULL;
else if (IS_ERR(data->pinctrl)) {
if (PTR_ERR(data->pinctrl) != -EPROBE_DEFER)
dev_err(dev, "pinctrl get failed, err=%ld\n",
PTR_ERR(data->pinctrl)); PTR_ERR(data->pinctrl));
return PTR_ERR(data->pinctrl); return PTR_ERR(data->pinctrl);
} }
...@@ -361,13 +364,13 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) ...@@ -361,13 +364,13 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
data->hsic_pad_regulator = data->hsic_pad_regulator =
devm_regulator_get_optional(dev, "hsic"); devm_regulator_get_optional(dev, "hsic");
if (PTR_ERR(data->hsic_pad_regulator) == -EPROBE_DEFER) { if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) {
return -EPROBE_DEFER;
} else if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) {
/* no pad regualator is needed */ /* no pad regualator is needed */
data->hsic_pad_regulator = NULL; data->hsic_pad_regulator = NULL;
} else if (IS_ERR(data->hsic_pad_regulator)) { } else if (IS_ERR(data->hsic_pad_regulator)) {
dev_err(dev, "Get HSIC pad regulator error: %ld\n", if (PTR_ERR(data->hsic_pad_regulator) != -EPROBE_DEFER)
dev_err(dev,
"Get HSIC pad regulator error: %ld\n",
PTR_ERR(data->hsic_pad_regulator)); PTR_ERR(data->hsic_pad_regulator));
return PTR_ERR(data->hsic_pad_regulator); return PTR_ERR(data->hsic_pad_regulator);
} }
......
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