summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-08 16:46:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-08 16:46:16 +0200
commit0f5b6ec67404246f3e08435aa37df3c8e9354101 (patch)
tree59d374004805dac98a8e2bd6643328c3eb8335fb
parent5ebe6afaf0057ac3eaeb98defd5456894b446d22 (diff)
parentbc1aabad39f42fa293f2a944fd9327bba27b59cd (diff)
downloadop-kernel-dev-0f5b6ec67404246f3e08435aa37df3c8e9354101.zip
op-kernel-dev-0f5b6ec67404246f3e08435aa37df3c8e9354101.tar.gz
Merge tag 'extcon-fixes-for-4.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-linus
Chanwoo writes: Update extcon for v4.1-rc2 This patchset fixes the NULL pointer deference issue of extcon-usb-gpio.c to prevent the interrupt occur before device initialization.
-rw-r--r--drivers/extcon/extcon-usb-gpio.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
index de67fce..e45d1f1 100644
--- a/drivers/extcon/extcon-usb-gpio.c
+++ b/drivers/extcon/extcon-usb-gpio.c
@@ -119,6 +119,18 @@ static int usb_extcon_probe(struct platform_device *pdev)
return PTR_ERR(info->id_gpiod);
}
+ info->edev = devm_extcon_dev_allocate(dev, usb_extcon_cable);
+ if (IS_ERR(info->edev)) {
+ dev_err(dev, "failed to allocate extcon device\n");
+ return -ENOMEM;
+ }
+
+ ret = devm_extcon_dev_register(dev, info->edev);
+ if (ret < 0) {
+ dev_err(dev, "failed to register extcon device\n");
+ return ret;
+ }
+
ret = gpiod_set_debounce(info->id_gpiod,
USB_GPIO_DEBOUNCE_MS * 1000);
if (ret < 0)
@@ -142,18 +154,6 @@ static int usb_extcon_probe(struct platform_device *pdev)
return ret;
}
- info->edev = devm_extcon_dev_allocate(dev, usb_extcon_cable);
- if (IS_ERR(info->edev)) {
- dev_err(dev, "failed to allocate extcon device\n");
- return -ENOMEM;
- }
-
- ret = devm_extcon_dev_register(dev, info->edev);
- if (ret < 0) {
- dev_err(dev, "failed to register extcon device\n");
- return ret;
- }
-
platform_set_drvdata(pdev, info);
device_init_wakeup(dev, 1);
OpenPOWER on IntegriCloud