linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: turn of_pinctrl_get() into a static inline
@ 2020-04-01  8:08 Stephen Rothwell
  2020-04-01  8:18 ` Stephen Rothwell
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2020-04-01  8:08 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Thierry Reding, Geert Uytterhoeven, Linux Next Mailing List,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1977 bytes --]

This avoids the overheads of an EXPORTed function.

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/pinctrl/devicetree.c    | 6 ------
 include/linux/pinctrl/pinctrl.h | 9 +++------
 2 files changed, 3 insertions(+), 12 deletions(-)

This is not even build tested, but is this what you meant, Geert?

diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index c6fe7d64c913..61abff89e5f8 100644
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -99,12 +99,6 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename,
 	return -ENOMEM;
 }
 
-struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
-{
-	return get_pinctrl_dev_from_of_node(np);
-}
-EXPORT_SYMBOL_GPL(of_pinctrl_get);
-
 static int dt_to_map_one_config(struct pinctrl *p,
 				struct pinctrl_dev *hog_pctldev,
 				const char *statename,
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 2aef59df93d7..e7b5cd5e1b10 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -186,15 +186,12 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
 				const char *pin_group, const unsigned **pins,
 				unsigned *num_pins);
 
-#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL)
-extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np);
-#else
-static inline
-struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
+static inline struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
 {
+	if (IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL))
+		return get_pinctrl_dev_from_of_node(np);
 	return NULL;
 }
-#endif /* CONFIG_OF */
 
 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
 extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
-- 
2.26.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpio: turn of_pinctrl_get() into a static inline
  2020-04-01  8:08 [PATCH] gpio: turn of_pinctrl_get() into a static inline Stephen Rothwell
@ 2020-04-01  8:18 ` Stephen Rothwell
  2020-04-01  8:20   ` Linus Walleij
  2020-04-01  8:26   ` Geert Uytterhoeven
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Rothwell @ 2020-04-01  8:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Thierry Reding, Geert Uytterhoeven, Linux Next Mailing List,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

Hi all,

On Wed, 1 Apr 2020 19:08:10 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> This avoids the overheads of an EXPORTed function.
> 
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/pinctrl/devicetree.c    | 6 ------
>  include/linux/pinctrl/pinctrl.h | 9 +++------
>  2 files changed, 3 insertions(+), 12 deletions(-)
> 
> This is not even build tested, but is this what you meant, Geert?

Actually this won't work because get_pinctrl_dev_from_of_node() is
declared in the private header file drivers/pinctrl/core.h :-(

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpio: turn of_pinctrl_get() into a static inline
  2020-04-01  8:18 ` Stephen Rothwell
@ 2020-04-01  8:20   ` Linus Walleij
  2020-04-01  8:26   ` Geert Uytterhoeven
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2020-04-01  8:20 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Thierry Reding, Geert Uytterhoeven, Linux Next Mailing List,
	Linux Kernel Mailing List

On Wed, Apr 1, 2020 at 10:18 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> On Wed, 1 Apr 2020 19:08:10 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > This avoids the overheads of an EXPORTed function.
> >
> > Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
> >  drivers/pinctrl/devicetree.c    | 6 ------
> >  include/linux/pinctrl/pinctrl.h | 9 +++------
> >  2 files changed, 3 insertions(+), 12 deletions(-)
> >
> > This is not even build tested, but is this what you meant, Geert?
>
> Actually this won't work because get_pinctrl_dev_from_of_node() is
> declared in the private header file drivers/pinctrl/core.h :-(

No big deal. We keep your other fix for now.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpio: turn of_pinctrl_get() into a static inline
  2020-04-01  8:18 ` Stephen Rothwell
  2020-04-01  8:20   ` Linus Walleij
@ 2020-04-01  8:26   ` Geert Uytterhoeven
  2020-04-01  8:43     ` Stephen Rothwell
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2020-04-01  8:26 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Linus Walleij, Thierry Reding, Linux Next Mailing List,
	Linux Kernel Mailing List

Hi Stephen,

On Wed, Apr 1, 2020 at 10:18 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> On Wed, 1 Apr 2020 19:08:10 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > This avoids the overheads of an EXPORTed function.
> >
> > Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
> >  drivers/pinctrl/devicetree.c    | 6 ------
> >  include/linux/pinctrl/pinctrl.h | 9 +++------
> >  2 files changed, 3 insertions(+), 12 deletions(-)
> >
> > This is not even build tested, but is this what you meant, Geert?
>
> Actually this won't work because get_pinctrl_dev_from_of_node() is
> declared in the private header file drivers/pinctrl/core.h :-(

Indeed :-(

Just realized this myself, while reviewing your patch.
Sorry for the bad suggestion.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpio: turn of_pinctrl_get() into a static inline
  2020-04-01  8:26   ` Geert Uytterhoeven
@ 2020-04-01  8:43     ` Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2020-04-01  8:43 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Thierry Reding, Linux Next Mailing List,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

Hi Geert,

On Wed, 1 Apr 2020 10:26:58 +0200 Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Just realized this myself, while reviewing your patch.
> Sorry for the bad suggestion.

No worries.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-01  8:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01  8:08 [PATCH] gpio: turn of_pinctrl_get() into a static inline Stephen Rothwell
2020-04-01  8:18 ` Stephen Rothwell
2020-04-01  8:20   ` Linus Walleij
2020-04-01  8:26   ` Geert Uytterhoeven
2020-04-01  8:43     ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).