Merge tag 'gpio-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[sfrench/cifs-2.6.git] / include / linux / gpio / consumer.h
index 8aebcf822082ea84ecbd7dafeecde7be662d1f00..9ddcf50a3c5924ad754d40029a3b0dd707ac556f 100644 (file)
@@ -163,7 +163,7 @@ int gpiod_is_active_low(const struct gpio_desc *desc);
 int gpiod_cansleep(const struct gpio_desc *desc);
 
 int gpiod_to_irq(const struct gpio_desc *desc);
-void gpiod_set_consumer_name(struct gpio_desc *desc, const char *name);
+int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name);
 
 /* Convert between the old gpio_ and new gpiod_ interfaces */
 struct gpio_desc *gpio_to_desc(unsigned gpio);
@@ -509,15 +509,17 @@ static inline int gpiod_to_irq(const struct gpio_desc *desc)
        return -EINVAL;
 }
 
-static inline void gpiod_set_consumer_name(struct gpio_desc *desc, const char *name)
+static inline int gpiod_set_consumer_name(struct gpio_desc *desc,
+                                         const char *name)
 {
        /* GPIO can never have been requested */
        WARN_ON(1);
+       return -EINVAL;
 }
 
 static inline struct gpio_desc *gpio_to_desc(unsigned gpio)
 {
-       return ERR_PTR(-EINVAL);
+       return NULL;
 }
 
 static inline int desc_to_gpio(const struct gpio_desc *desc)