diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-06-10 15:09:21 -0400 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2017-06-11 21:00:24 -0400 |
commit | 1f4be24786b8521945b00e1810576911994ba504 (patch) | |
tree | 470bb5401102d71b03ce81d09c91bf719338ad76 | |
parent | a781a7d646ada7a69da4d2a804fe3405f2606b17 (diff) |
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>
-rw-r--r-- | drivers/extcon/extcon-intel-int3496.c | 5 |
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) | |||
94 | struct int3496_data *data; | 94 | struct int3496_data *data; |
95 | int ret; | 95 | int ret; |
96 | 96 | ||
97 | ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), | 97 | ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios); |
98 | acpi_int3496_default_gpios); | ||
99 | if (ret) { | 98 | if (ret) { |
100 | dev_err(dev, "can't add GPIO ACPI mapping\n"); | 99 | dev_err(dev, "can't add GPIO ACPI mapping\n"); |
101 | return ret; | 100 | return ret; |
@@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev) | |||
169 | devm_free_irq(&pdev->dev, data->usb_id_irq, data); | 168 | devm_free_irq(&pdev->dev, data->usb_id_irq, data); |
170 | cancel_delayed_work_sync(&data->work); | 169 | cancel_delayed_work_sync(&data->work); |
171 | 170 | ||
172 | acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev)); | ||
173 | |||
174 | return 0; | 171 | return 0; |
175 | } | 172 | } |
176 | 173 | ||