summaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-06-10 22:09:21 +0300
committerChanwoo Choi <cw00.choi@samsung.com>2017-06-12 10:00:24 +0900
commit1f4be24786b8521945b00e1810576911994ba504 (patch)
tree470bb5401102d71b03ce81d09c91bf719338ad76 /drivers/extcon
parenta781a7d646ada7a69da4d2a804fe3405f2606b17 (diff)
downloadlinux-1f4be24786b8521945b00e1810576911994ba504.tar.gz
linux-1f4be24786b8521945b00e1810576911994ba504.tar.bz2
linux-1f4be24786b8521945b00e1810576911994ba504.zip
extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios()
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify error path and fix potentially wrong assingment if ->probe() fails. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-intel-int3496.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
index 9d17984bbbd4..d9f9afe45961 100644
--- a/drivers/extcon/extcon-intel-int3496.c
+++ b/drivers/extcon/extcon-intel-int3496.c
@@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev)
struct int3496_data *data;
int ret;
- ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
- acpi_int3496_default_gpios);
+ ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
if (ret) {
dev_err(dev, "can't add GPIO ACPI mapping\n");
return ret;
@@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev)
devm_free_irq(&pdev->dev, data->usb_id_irq, data);
cancel_delayed_work_sync(&data->work);
- acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
-
return 0;
}