Commit 1f4be247 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Chanwoo Choi

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent a781a7d6
...@@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev) ...@@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev)
struct int3496_data *data; struct int3496_data *data;
int ret; int ret;
ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
acpi_int3496_default_gpios);
if (ret) { if (ret) {
dev_err(dev, "can't add GPIO ACPI mapping\n"); dev_err(dev, "can't add GPIO ACPI mapping\n");
return ret; return ret;
...@@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev) ...@@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev)
devm_free_irq(&pdev->dev, data->usb_id_irq, data); devm_free_irq(&pdev->dev, data->usb_id_irq, data);
cancel_delayed_work_sync(&data->work); cancel_delayed_work_sync(&data->work);
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
return 0; return 0;
} }
......
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