History

gpiolib: of: Reshuffle contents of consumer.h for new library layout

Kernel build bot reported a compilation error after the commit f626d6dfb709 ("gpio: of: Break out OF-only code"): drivers/gpio/gpiolib-devres.o: In function `devm_gpiod_get_from_of_node': gpiolib-devres.c:(.text+0x19a): undefined reference to `gpiod_get_from_of_node' This happens due to move the latter under umbrella of CONFIG_OF_GPIO while customer.h contains staled data. Fix it by reshuffling contents of consumer.h to satisfy build dependencies.

Andy Shevchenko committed 7 years ago

Commit fce04b11 parent a2997261 file · +48 −30Browse files

Unified · Split

include/linux/gpio/consumer.h+48−30
@@ -170,18 +170,8 @@ struct gpio_desc *gpio_to_desc(unsigned gpio); · 169 unmodified lines
170int desc_to_gpio(const struct gpio_desc *desc);170int desc_to_gpio(const struct gpio_desc *desc);
171 171
172/* Child properties interface */172/* Child properties interface */
173struct device_node;
174struct fwnode_handle;173struct fwnode_handle;
175 174
176struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
177 const char *propname, int index,
178 enum gpiod_flags dflags,
179 const char *label);
180struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
181 struct device_node *node,
182 const char *propname, int index,
183 enum gpiod_flags dflags,
184 const char *label);
185struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,175struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
186 const char *propname, int index,176 const char *propname, int index,
187 enum gpiod_flags dflags,177 enum gpiod_flags dflags,
@@ -530,28 +520,8 @@ static inline int desc_to_gpio(const struct gpio_desc *desc) · 342 unmodified lines
530}520}
531 521
532/* Child properties interface */522/* Child properties interface */
533struct device_node;
534struct fwnode_handle;523struct fwnode_handle;
535 524
536static inline
537struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
538 const char *propname, int index,
539 enum gpiod_flags dflags,
540 const char *label)
541{
542 return ERR_PTR(-ENOSYS);
543}
544
545static inline
546struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
547 struct device_node *node,
548 const char *propname, int index,
549 enum gpiod_flags dflags,
550 const char *label)
551{
552 return ERR_PTR(-ENOSYS);
553}
554
555static inline525static inline
556struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,526struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
557 const char *propname, int index,527 const char *propname, int index,
@@ -584,6 +554,54 @@ struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, · 26 unmodified lines
584 flags, label);554 flags, label);
585}555}
586 556
557#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_OF_GPIO)
558struct device_node;
559
560struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
561 const char *propname, int index,
562 enum gpiod_flags dflags,
563 const char *label);
564
565#else /* CONFIG_GPIOLIB && CONFIG_OF_GPIO */
566
567struct device_node;
568
569static inline
570struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
571 const char *propname, int index,
572 enum gpiod_flags dflags,
573 const char *label)
574{
575 return ERR_PTR(-ENOSYS);
576}
577
578#endif /* CONFIG_GPIOLIB && CONFIG_OF_GPIO */
579
580#ifdef CONFIG_GPIOLIB
581struct device_node;
582
583struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
584 struct device_node *node,
585 const char *propname, int index,
586 enum gpiod_flags dflags,
587 const char *label);
588
589#else /* CONFIG_GPIOLIB */
590
591struct device_node;
592
593static inline
594struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
595 struct device_node *node,
596 const char *propname, int index,
597 enum gpiod_flags dflags,
598 const char *label)
599{
600 return ERR_PTR(-ENOSYS);
601}
602
603#endif /* CONFIG_GPIOLIB */
604
587#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)605#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
588 606
589int gpiod_export(struct gpio_desc *desc, bool direction_may_change);607int gpiod_export(struct gpio_desc *desc, bool direction_may_change);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t