mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 06:21:31 +00:00
gpio: acpi: Add managed variant of acpi_dev_add_driver_gpios()
Introduce device managed variant of acpi_dev_add_driver_gpios() and its counterpart acpi_dev_remove_driver_gpios(). The functions in most cases are used in driver's ->probe() and ->remove() callbacks, that's why it's useful to have managed variant of them. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Rafael J. Wysocki <rjw@rjwysocki.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
ff21378a32
commit
85c73d50e5
2 changed files with 42 additions and 0 deletions
|
@ -952,6 +952,10 @@ static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev)
|
|||
adev->driver_gpios = NULL;
|
||||
}
|
||||
|
||||
int devm_acpi_dev_add_driver_gpios(struct device *dev,
|
||||
const struct acpi_gpio_mapping *gpios);
|
||||
void devm_acpi_dev_remove_driver_gpios(struct device *dev);
|
||||
|
||||
int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index);
|
||||
#else
|
||||
static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
|
||||
|
@ -961,6 +965,13 @@ static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
|
|||
}
|
||||
static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
|
||||
|
||||
static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
|
||||
const struct acpi_gpio_mapping *gpios)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
static inline void devm_acpi_dev_remove_driver_gpios(struct device *dev) {}
|
||||
|
||||
static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
|
||||
{
|
||||
return -ENXIO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue