Skip to content

Commit 1f4be24

Browse files
andy-shevchanwoochoi
authored andcommitted
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 <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent a781a7d commit 1f4be24

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/extcon/extcon-intel-int3496.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev)
9494
struct int3496_data *data;
9595
int ret;
9696

97-
ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
98-
acpi_int3496_default_gpios);
97+
ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
9998
if (ret) {
10099
dev_err(dev, "can't add GPIO ACPI mapping\n");
101100
return ret;
@@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev)
169168
devm_free_irq(&pdev->dev, data->usb_id_irq, data);
170169
cancel_delayed_work_sync(&data->work);
171170

172-
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
173-
174171
return 0;
175172
}
176173

0 commit comments

Comments
 (0)