Skip to contentSkip to conversation

driver core: make pinctrl_bind_pins() private

PATCH In review Bartosz Golaszewski 4 participants 6 messages Jan 8 – Jan 18

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

PATCH 1/1 driver core: make pinctrl_bind_pins() private

pinctrl_bind_pins() is only used by driver core (as it should). Move it out of the public header into base.h.

---
 drivers/base/base.h             | 9 +++++++++
 drivers/base/pinctrl.c          | 2 ++
 include/linux/pinctrl/devinfo.h | 6 ------
 3 files changed, 11 insertions(+), 6 deletions(-)
drivers/base/base.h +9 -0
index 430cbefbc97f..aafc0adbe77d 100644
@@ -289,3 +289,12 @@ static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
 
 void software_node_notify(struct device *dev);
 void software_node_notify_remove(struct device *dev);
+
+#ifdef CONFIG_PINCTRL
+int pinctrl_bind_pins(struct device *dev);
+#else
+static inline int pinctrl_bind_pins(struct device *dev)
+{
+	return 0;
+}
+#endif /* CONFIG_PINCTRL */
drivers/base/pinctrl.c +2 -0
index c22864458511..6e250272c843 100644
@@ -14,6 +14,8 @@
 #include <linux/pinctrl/consumer.h>
 #include <linux/slab.h>
 
+#include "base.h"
+
 /**
  * pinctrl_bind_pins() - called by the device core before probe
  * @dev: the device that is just about to probe
include/linux/pinctrl/devinfo.h +0 -6
index bb6653af4f92..de4228eea90a 100644
@@ -43,7 +43,6 @@ struct dev_pin_info {
 #endif
 };
 
-extern int pinctrl_bind_pins(struct device *dev);
 extern int pinctrl_init_done(struct device *dev);
 
 static inline struct pinctrl *dev_pinctrl(struct device *dev)
@@ -58,11 +57,6 @@ static inline struct pinctrl *dev_pinctrl(struct device *dev)
 
 /* Stubs if we're not using pinctrl */
 
-static inline int pinctrl_bind_pins(struct device *dev)
-{
-	return 0;
-}
-
 static inline int pinctrl_init_done(struct device *dev)
 {
 	return 0;
Signature · 1 line
2.47.3
maintainer
#1 lore raw
Quoted 4 lines · Bartosz Golaszewski

pinctrl_bind_pins() is only used by driver core (as it should). Move it out of the public header into base.h.

Oh good point.

I guess technically base.h is Greg's file so I'll wait and see if he has something to say before applying it.

Yours,
Linus Walleij

maintainer Reviewed-by on v1 1/1
#4 lore raw
In reply to Bartosz Golaszewski
Quoted 9 lines · Bartosz Golaszewski

pinctrl_bind_pins() is only used by driver core (as it should). Move it out of the public header into base.h.

---
 drivers/base/base.h             | 9 +++++++++
 drivers/base/pinctrl.c          | 2 ++
 include/linux/pinctrl/devinfo.h | 6 ------
 3 files changed, 11 insertions(+), 6 deletions(-)