linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: pxa: Explicitly include correct DT includes
@ 2023-10-09 17:29 Rob Herring
  2023-10-11  8:41 ` Uwe Kleine-König
  2023-10-12 13:55 ` Thierry Reding
  0 siblings, 2 replies; 4+ messages in thread
From: Rob Herring @ 2023-10-09 17:29 UTC (permalink / raw)
  To: Thierry Reding, Uwe Kleine-König; +Cc: linux-pwm, linux-kernel

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/pwm/pwm-pxa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index 1e475ed10180..78b04e017c49 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -24,7 +24,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/pwm.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 
 #include <asm/div64.h>
 
-- 
2.42.0


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

* Re: [PATCH] pwm: pxa: Explicitly include correct DT includes
  2023-10-09 17:29 [PATCH] pwm: pxa: Explicitly include correct DT includes Rob Herring
@ 2023-10-11  8:41 ` Uwe Kleine-König
  2023-10-12 19:48   ` Rob Herring
  2023-10-12 13:55 ` Thierry Reding
  1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2023-10-11  8:41 UTC (permalink / raw)
  To: Rob Herring; +Cc: Thierry Reding, linux-pwm, linux-kernel

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

On Mon, Oct 09, 2023 at 12:29:17PM -0500, Rob Herring wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/pwm/pwm-pxa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
> index 1e475ed10180..78b04e017c49 100644
> --- a/drivers/pwm/pwm-pxa.c
> +++ b/drivers/pwm/pwm-pxa.c
> @@ -24,7 +24,7 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/pwm.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>

Even without both headers the driver compiles fine as linux/pwm.h
includes of.h.

I think we should do:

diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index d2f9f690a9c1..9e35970ca2ab 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -4,8 +4,8 @@
 
 #include <linux/err.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
 
+struct of_phandle_args;
 struct pwm_chip;
 
 /**

drivers/pmw/* compiles fine with this change.

Other than that:

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

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

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

* Re: [PATCH] pwm: pxa: Explicitly include correct DT includes
  2023-10-09 17:29 [PATCH] pwm: pxa: Explicitly include correct DT includes Rob Herring
  2023-10-11  8:41 ` Uwe Kleine-König
@ 2023-10-12 13:55 ` Thierry Reding
  1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2023-10-12 13:55 UTC (permalink / raw)
  To: Uwe Kleine-König, Rob Herring; +Cc: linux-pwm, linux-kernel


On Mon, 09 Oct 2023 12:29:17 -0500, Rob Herring wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
> 
> [...]

Applied, thanks!

[1/1] pwm: pxa: Explicitly include correct DT includes
      commit: 1d1d7ed2fb47b83496bb708eca0974a2741eb8ca

Best regards,
-- 
Thierry Reding <thierry.reding@gmail.com>

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

* Re: [PATCH] pwm: pxa: Explicitly include correct DT includes
  2023-10-11  8:41 ` Uwe Kleine-König
@ 2023-10-12 19:48   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2023-10-12 19:48 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Thierry Reding, linux-pwm, linux-kernel

On Wed, Oct 11, 2023 at 3:41 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> On Mon, Oct 09, 2023 at 12:29:17PM -0500, Rob Herring wrote:
> > The DT of_device.h and of_platform.h date back to the separate
> > of_platform_bus_type before it as merged into the regular platform bus.
> > As part of that merge prepping Arm DT support 13 years ago, they
> > "temporarily" include each other. They also include platform_device.h
> > and of.h. As a result, there's a pretty much random mix of those include
> > files used throughout the tree. In order to detangle these headers and
> > replace the implicit includes with struct declarations, users need to
> > explicitly include the correct includes.
> >
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  drivers/pwm/pwm-pxa.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
> > index 1e475ed10180..78b04e017c49 100644
> > --- a/drivers/pwm/pwm-pxa.c
> > +++ b/drivers/pwm/pwm-pxa.c
> > @@ -24,7 +24,7 @@
> >  #include <linux/clk.h>
> >  #include <linux/io.h>
> >  #include <linux/pwm.h>
> > -#include <linux/of_device.h>
> > +#include <linux/of.h>
>
> Even without both headers the driver compiles fine as linux/pwm.h
> includes of.h.

Yes, that's just one of several:

 include/linux/pm_domain.h  | 4 +++-
 include/linux/remoteproc.h | 3 ++-
 include/linux/thermal.h    | 4 +++-
 include/linux/cpu_cooling.h                | 1 -
 include/linux/fsl/bestcomm/bestcomm_priv.h | 1 -
 include/linux/mailbox_client.h             | 4 ++--
 include/linux/mailbox_controller.h         | 2 +-
 include/linux/phy/phy.h                    | 5 +++--
 include/linux/pwm.h                        | 4 +++-
 include/net/dsa.h                          | 2 +-

>
> I think we should do:
>
> diff --git a/include/linux/pwm.h b/include/linux/pwm.h
> index d2f9f690a9c1..9e35970ca2ab 100644
> --- a/include/linux/pwm.h
> +++ b/include/linux/pwm.h
> @@ -4,8 +4,8 @@
>
>  #include <linux/err.h>
>  #include <linux/mutex.h>
> -#include <linux/of.h>
>
> +struct of_phandle_args;

Also used in the header:

+struct device;
+struct fwnode_handle;

>  struct pwm_chip;
>
>  /**
>
> drivers/pmw/* compiles fine with this change.

Agreed in what I tested so far.

But I'm running out of gas on doing more of this, so once I get
of_device.h and of_platform.h detangled, I'm probably done for a while
at least. IOW, feel free to submit a patch for pwm.h.

>
> Other than that:
>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks!

Rob

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

end of thread, other threads:[~2023-10-12 19:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-09 17:29 [PATCH] pwm: pxa: Explicitly include correct DT includes Rob Herring
2023-10-11  8:41 ` Uwe Kleine-König
2023-10-12 19:48   ` Rob Herring
2023-10-12 13:55 ` Thierry Reding

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).