Skip to contentSkip to conversation

gpiolib: acpi: make acpi_can_fallback_to_crs() static

PATCH In review Dmitry Torokhov 4 participants 4 messages Sep 4, 2019 – Sep 10, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: acpi: make acpi_can_fallback_to_crs() static

It is not used outside gpiolib-acpi.c module, so there is no need to export it.

---
 drivers/gpio/gpiolib-acpi.c | 19 ++++++++++---------
 drivers/gpio/gpiolib-acpi.h |  8 --------
 2 files changed, 10 insertions(+), 17 deletions(-)
drivers/gpio/gpiolib-acpi.c +10 -9
index fdee8afa5339..2b6fdc9947f7 100644
@@ -728,6 +728,16 @@ static struct gpio_desc *acpi_get_gpiod_by_index(struct acpi_device *adev,
 	return ret ? ERR_PTR(ret) : lookup.desc;
 }
 
+static bool acpi_can_fallback_to_crs(struct acpi_device *adev,
+				     const char *con_id)
+{
+	/* Never allow fallback if the device has properties */
+	if (acpi_dev_has_props(adev) || adev->driver_gpios)
+		return false;
+
+	return con_id == NULL;
+}
+
 struct gpio_desc *acpi_find_gpio(struct device *dev,
 				 const char *con_id,
 				 unsigned int idx,
@@ -1264,15 +1274,6 @@ int acpi_gpio_count(struct device *dev, const char *con_id)
 	return count ? count : -ENOENT;
 }
 
-bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
-{
-	/* Never allow fallback if the device has properties */
-	if (acpi_dev_has_props(adev) || adev->driver_gpios)
-		return false;
-
-	return con_id == NULL;
-}
-
 /* Run deferred acpi_gpiochip_request_irqs() */
 static int acpi_gpio_handle_deferred_request_irqs(void)
 {
drivers/gpio/gpiolib-acpi.h +0 -8
index d7241b432b8b..1c6d65cf0629 100644
@@ -52,8 +52,6 @@ struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode,
 				      struct acpi_gpio_info *info);
 
 int acpi_gpio_count(struct device *dev, const char *con_id);
-
-bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id);
 #else
 static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
 static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
@@ -93,12 +91,6 @@ static inline int acpi_gpio_count(struct device *dev, const char *con_id)
 {
 	return -ENODEV;
 }
-
-static inline bool acpi_can_fallback_to_crs(struct acpi_device *adev,
-					    const char *con_id)
-{
-	return false;
-}
 #endif
 
 #endif /* GPIOLIB_ACPI_H */
Signature · 5 lines
2.23.0.187.g17f5b7556c-goog


-- 
Dmitry
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dmitry Torokhov

It is not used outside gpiolib-acpi.c module, so there is no need to export it.

Thank you for a nice clean up!

Quoted 75 lines
---
 drivers/gpio/gpiolib-acpi.c | 19 ++++++++++---------
 drivers/gpio/gpiolib-acpi.h |  8 --------
 2 files changed, 10 insertions(+), 17 deletions(-)
drivers/gpio/gpiolib-acpi.c +10 -9
index fdee8afa5339..2b6fdc9947f7 100644
@@ -728,6 +728,16 @@ static struct gpio_desc *acpi_get_gpiod_by_index(struct acpi_device *adev,
 	return ret ? ERR_PTR(ret) : lookup.desc;
 }
 
+static bool acpi_can_fallback_to_crs(struct acpi_device *adev,
+				     const char *con_id)
+{
+	/* Never allow fallback if the device has properties */
+	if (acpi_dev_has_props(adev) || adev->driver_gpios)
+		return false;
+
+	return con_id == NULL;
+}
+
 struct gpio_desc *acpi_find_gpio(struct device *dev,
 				 const char *con_id,
 				 unsigned int idx,
@@ -1264,15 +1274,6 @@ int acpi_gpio_count(struct device *dev, const char *con_id)
 	return count ? count : -ENOENT;
 }
 
-bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
-{
-	/* Never allow fallback if the device has properties */
-	if (acpi_dev_has_props(adev) || adev->driver_gpios)
-		return false;
-
-	return con_id == NULL;
-}
-
 /* Run deferred acpi_gpiochip_request_irqs() */
 static int acpi_gpio_handle_deferred_request_irqs(void)
 {
drivers/gpio/gpiolib-acpi.h +0 -8
index d7241b432b8b..1c6d65cf0629 100644
@@ -52,8 +52,6 @@ struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode,
 				      struct acpi_gpio_info *info);
 
 int acpi_gpio_count(struct device *dev, const char *con_id);
-
-bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id);
 #else
 static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
 static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
@@ -93,12 +91,6 @@ static inline int acpi_gpio_count(struct device *dev, const char *con_id)
 {
 	return -ENODEV;
 }
-
-static inline bool acpi_can_fallback_to_crs(struct acpi_device *adev,
-					    const char *con_id)
-{
-	return false;
-}
 #endif
 
 #endif /* GPIOLIB_ACPI_H */
Signature · 5 lines
2.23.0.187.g17f5b7556c-goog


-- 
Dmitry
Signature · 2 lines
With Best Regards,
Andy Shevchenko