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 <andriy.shevchenko@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
6dad28ae19
commit
4524667b1e
1 changed files with 1 additions and 4 deletions
|
@ -81,8 +81,7 @@ static int rfkill_gpio_acpi_probe(struct device *dev,
|
||||||
|
|
||||||
rfkill->type = (unsigned)id->driver_data;
|
rfkill->type = (unsigned)id->driver_data;
|
||||||
|
|
||||||
return acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
|
return devm_acpi_dev_add_driver_gpios(dev, acpi_rfkill_default_gpios);
|
||||||
acpi_rfkill_default_gpios);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rfkill_gpio_probe(struct platform_device *pdev)
|
static int rfkill_gpio_probe(struct platform_device *pdev)
|
||||||
|
@ -154,8 +153,6 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
|
||||||
rfkill_unregister(rfkill->rfkill_dev);
|
rfkill_unregister(rfkill->rfkill_dev);
|
||||||
rfkill_destroy(rfkill->rfkill_dev);
|
rfkill_destroy(rfkill->rfkill_dev);
|
||||||
|
|
||||||
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue