Skip to contentSkip to conversation

pinctrl: include linux/errno.h in consumer.h for ENOTSUPP

PATCH In review Mehmet Fide 3 participants 3 messages Sep 24

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

PATCH 1/1 pinctrl: include linux/errno.h in consumer.h for ENOTSUPP

From: Mehmet Fide <[email protected]>

The CONFIG_PINCTRL=n stubs of pinctrl_gpio_get_config() and pinctrl_gpio_set_config() return -ENOTSUPP, but the header only pulls in linux/err.h, which provides asm/errno.h and not the kernel-internal ENOTSUPP from linux/errno.h. A translation unit that includes pinctrl/consumer.h before anything else fails to build:

include/linux/pinctrl/consumer.h:110:10: error: use of undeclared identifier 'ENOTSUPP'

Include linux/errno.h explicitly.

---
 include/linux/pinctrl/consumer.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/pinctrl/consumer.h +1 -0
index 7be49d447426..81e7866bd2e3 100644
@@ -12,6 +12,7 @@
 #define __LINUX_PINCTRL_CONSUMER_H
 
 #include <linux/err.h>
+#include <linux/errno.h>
 #include <linux/types.h>
 
 #include <linux/pinctrl/pinctrl-state.h>
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines · Mehmet Fide

From: Mehmet Fide <[email protected]>

The CONFIG_PINCTRL=n stubs of pinctrl_gpio_get_config() and pinctrl_gpio_set_config() return -ENOTSUPP, but the header only pulls in linux/err.h, which provides asm/errno.h and not the kernel-internal ENOTSUPP from linux/errno.h. A translation unit that includes pinctrl/consumer.h before anything else fails to build:

include/linux/pinctrl/consumer.h:110:10: error: use of undeclared identifier 'ENOTSUPP'

Include linux/errno.h explicitly.

---
 include/linux/pinctrl/consumer.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/pinctrl/consumer.h +1 -1
index 7be49d447426..81e7866bd2e3 100644
@@ -12,6 +12,7 @@
 #define __LINUX_PINCTRL_CONSUMER_H
 
 #include <linux/err.h>
+#include <linux/errno.h>
 #include <linux/types.h>
 
 #include <linux/pinctrl/pinctrl-state.h>
--
Quoted 3 lines

2.55.0

maintainer
#2 lore raw
In reply to Mehmet Fide
Quoted 10 lines · Mehmet Fide

From: Mehmet Fide <[email protected]>

The CONFIG_PINCTRL=n stubs of pinctrl_gpio_get_config() and pinctrl_gpio_set_config() return -ENOTSUPP, but the header only pulls in linux/err.h, which provides asm/errno.h and not the kernel-internal ENOTSUPP from linux/errno.h. A translation unit that includes pinctrl/consumer.h before anything else fails to build:

include/linux/pinctrl/consumer.h:110:10: error: use of undeclared identifier 'ENOTSUPP'

Quoted 7 lines

Include linux/errno.h explicitly.

Patch applied!

Yours,
Linus Walleij