]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
gpio: Fix build breakage
authorThierry Reding <treding@nvidia.com>
Mon, 21 Oct 2013 15:26:48 +0000 (17:26 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 24 Oct 2013 13:03:00 +0000 (15:03 +0200)
Signed-off-by: Thierry Reding <treding@nvidia.com>
include/linux/gpio.h
include/linux/gpio/consumer.h
include/linux/gpio/driver.h
include/linux/of_gpio.h

index 7b92e0a235b427bc2ad13ec293a5b04afa1969ad..40696d5afec3fdfb850e4513bbe14404f12ef129 100644 (file)
@@ -87,6 +87,7 @@ static inline int irq_to_gpio(unsigned int irq)
 
 struct device;
 struct gpio_chip;
+struct pinctrl_dev;
 
 static inline bool gpio_is_valid(int number)
 {
index 4d34dbbbad4dde2ce2c1cd820320537661575450..e944c46d32280881209104f4d0d5d8ad90bd2f14 100644 (file)
@@ -26,13 +26,6 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
                                               unsigned int idx);
 void gpiod_put(struct gpio_desc *desc);
 
-struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
-                                             const char *con_id);
-struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
-                                                   const char *con_id,
-                                                   unsigned int idx);
-void devm_gpiod_put(struct device *dev, struct gpio_desc *desc);
-
 int gpiod_get_direction(const struct gpio_desc *desc);
 int gpiod_direction_input(struct gpio_desc *desc);
 int gpiod_direction_output(struct gpio_desc *desc, int value);
@@ -68,33 +61,15 @@ static inline struct gpio_desc *__must_check gpiod_get(struct device *dev,
 {
        return ERR_PTR(-ENOSYS);
 }
+
 static inline struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
                                                             const char *con_id,
                                                             unsigned int idx)
 {
        return ERR_PTR(-ENOSYS);
 }
-static inline void gpiod_put(struct gpio_desc *desc)
-{
-       might_sleep();
-
-       /* GPIO can never have been requested */
-       WARN_ON(1);
-}
 
-static inline struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
-                                                           const char *con_id)
-{
-       return ERR_PTR(-ENOSYS);
-}
-static inline
-struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
-                                                   const char *con_id,
-                                                   unsigned int idx)
-{
-       return ERR_PTR(-ENOSYS);
-}
-static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc)
+static inline void gpiod_put(struct gpio_desc *desc)
 {
        might_sleep();
 
@@ -102,19 +77,20 @@ static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc)
        WARN_ON(1);
 }
 
-
 static inline int gpiod_get_direction(const struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
        return -ENOSYS;
 }
+
 static inline int gpiod_direction_input(struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
        return -ENOSYS;
 }
+
 static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
 {
        /* GPIO can never have been requested */
@@ -122,24 +98,26 @@ static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
        return -ENOSYS;
 }
 
-
 static inline int gpiod_get_value(const struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
        return 0;
 }
+
 static inline void gpiod_set_value(struct gpio_desc *desc, int value)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
 }
+
 static inline int gpiod_get_raw_value(const struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
        return 0;
 }
+
 static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
 {
        /* GPIO can never have been requested */
@@ -152,17 +130,20 @@ static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)
        WARN_ON(1);
        return 0;
 }
+
 static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
 }
+
 static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
        return 0;
 }
+
 static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,
                                                int value)
 {
@@ -183,6 +164,7 @@ static inline int gpiod_is_active_low(const struct gpio_desc *desc)
        WARN_ON(1);
        return 0;
 }
+
 static inline int gpiod_cansleep(const struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
@@ -201,12 +183,14 @@ static inline struct gpio_desc *gpio_to_desc(unsigned gpio)
 {
        return ERR_PTR(-EINVAL);
 }
+
 static inline int desc_to_gpio(const struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
        return -EINVAL;
 }
+
 static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
 {
        /* GPIO can never have been requested */
@@ -214,7 +198,6 @@ static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
        return ERR_PTR(-ENODEV);
 }
 
-
 #endif /* CONFIG_GPIOLIB */
 
 #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
@@ -250,4 +233,35 @@ static inline void gpiod_unexport(struct gpio_desc *desc)
 
 #endif /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */
 
+#ifdef CONFIG_GPIO_DEVRES
+struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
+                                             const char *con_id);
+struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
+                                                   const char *con_id,
+                                                   unsigned int idx);
+void devm_gpiod_put(struct device *dev, struct gpio_desc *desc);
+#else
+static inline struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
+                                                           const char *con_id)
+{
+       return ERR_PTR(-ENOSYS);
+}
+
+static inline
+struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
+                                                   const char *con_id,
+                                                   unsigned int idx)
+{
+       return ERR_PTR(-ENOSYS);
+}
+
+static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc)
+{
+       might_sleep();
+
+       /* GPIO can never have been requested */
+       WARN_ON(1);
+}
+#endif
+
 #endif
index cd9da3885d79cd7d61b85dba7bf3e50714242e21..656a27efb2c8cdd755cd78e20a36e5dd028e5310 100644 (file)
@@ -5,6 +5,7 @@
 
 struct device;
 struct gpio_desc;
+struct seq_file;
 
 /**
  * struct gpio_chip - abstract a GPIO controller
index d71f2cc141ae3f6607da4940441643ee1ab8e7fa..2c98e76e286fef7a21417a962e242fecb830dbd9 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/of.h>
 
 struct device_node;