From 0d5102fe85302aa06a3e5fd8e63b09294aed4c48 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 28 Nov 2018 13:45:29 +0200 Subject: i2c: acpi: Introduce i2c_acpi_get_i2c_resource() helper Besides current two users one more is coming. Definitely makes sense to introduce a helper. No functional change intended. Signed-off-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Reviewed-by: Hans de Goede Acked-by: Mika Westerberg Acked-by: Wolfram Sang --- include/linux/acpi.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux/acpi.h') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ed80f147bd50..6afc6e3c4c5c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1054,6 +1054,17 @@ static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) } #endif +#if defined(CONFIG_ACPI) && IS_ENABLED(CONFIG_I2C) +bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares, + struct acpi_resource_i2c_serialbus **i2c); +#else +static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares, + struct acpi_resource_i2c_serialbus **i2c) +{ + return false; +} +#endif + /* Device properties */ #ifdef CONFIG_ACPI -- cgit v1.2.3-58-ga151