Skip to content

Commit 4524667

Browse files
andy-shevjmberg-intel
authored andcommitted
net: rfkill: gpio: 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: Johannes Berg <[email protected]>
1 parent 6dad28a commit 4524667

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

net/rfkill/rfkill-gpio.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ static int rfkill_gpio_acpi_probe(struct device *dev,
8181

8282
rfkill->type = (unsigned)id->driver_data;
8383

84-
return acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
85-
acpi_rfkill_default_gpios);
84+
return devm_acpi_dev_add_driver_gpios(dev, acpi_rfkill_default_gpios);
8685
}
8786

8887
static int rfkill_gpio_probe(struct platform_device *pdev)
@@ -154,8 +153,6 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
154153
rfkill_unregister(rfkill->rfkill_dev);
155154
rfkill_destroy(rfkill->rfkill_dev);
156155

157-
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
158-
159156
return 0;
160157
}
161158

0 commit comments

Comments
 (0)