diff options
author | Peter Chen | 2017-06-23 14:39:27 +0800 |
---|---|---|
committer | Peter Chen | 2017-07-25 15:22:44 +0800 |
commit | 7c3a8b81503ce8e6ab22341f0267d30085d17194 (patch) | |
tree | 6916e32d5c35494818540b7a4fdab1da148f183c /drivers/usb | |
parent | b74c43156c0caf392d93baae3df8e1788f799646 (diff) |
usb: chipidea: core: do not register extcon notifier if extcon device is not existed
This issue is detected when the system has another device driver
which registers USB connector extcon device, fix it by adding
extcon device check.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index b17ed3a9a304..a91736bfc5c2 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -736,7 +736,7 @@ static int ci_extcon_register(struct ci_hdrc *ci) id = &ci->platdata->id_extcon; id->ci = ci; - if (!IS_ERR(id->edev)) { + if (!IS_ERR_OR_NULL(id->edev)) { ret = devm_extcon_register_notifier(ci->dev, id->edev, EXTCON_USB_HOST, &id->nb); if (ret < 0) { @@ -747,7 +747,7 @@ static int ci_extcon_register(struct ci_hdrc *ci) vbus = &ci->platdata->vbus_extcon; vbus->ci = ci; - if (!IS_ERR(vbus->edev)) { + if (!IS_ERR_OR_NULL(vbus->edev)) { ret = devm_extcon_register_notifier(ci->dev, vbus->edev, EXTCON_USB, &vbus->nb); if (ret < 0) { |