Skip to content

Commit

Permalink
extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Chanwoo Choi committed Jun 12, 2017
1 parent a781a7d commit 1f4be24
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/extcon/extcon-intel-int3496.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1f4be24

Please sign in to comment.