drm/tegra: Clean up GPIO includes

Message ID 20200415122427.111769-1-linus.walleij@linaro.org
State New
Headers show
Series
  • drm/tegra: Clean up GPIO includes
Related show

Commit Message

Linus Walleij April 15, 2020, 12:24 p.m.
The Tegra DRM drivers includes the legacy GPIO headers
<linux/gpio.h> and <linux/of_gpio.h> but what it really
uses is <linux/gpio/consumer.h> since only gpio_desc
structs are ever referenced.

Include the right header on the top level tegra/drm.h
file and drop all the surplus includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/gpu/drm/tegra/dpaux.c | 2 --
 drivers/gpu/drm/tegra/drm.h   | 2 +-
 drivers/gpu/drm/tegra/hdmi.c  | 1 -
 drivers/gpu/drm/tegra/sor.c   | 1 -
 4 files changed, 1 insertion(+), 5 deletions(-)

-- 
2.25.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Comments

Daniel Vetter April 15, 2020, 12:43 p.m. | #1
On Wed, Apr 15, 2020 at 02:24:27PM +0200, Linus Walleij wrote:
> The Tegra DRM drivers includes the legacy GPIO headers

> <linux/gpio.h> and <linux/of_gpio.h> but what it really

> uses is <linux/gpio/consumer.h> since only gpio_desc

> structs are ever referenced.

> 

> Include the right header on the top level tegra/drm.h

> file and drop all the surplus includes.

> 

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


Hm, I wonder whether we should do similar splits for drm_bridge and
drm_panel, so that drivers don't pick the wrong interfaces ...

Anyway this looks neat, I spent a bit of time looking at how this is done,
fwiw (not much) and assuming it compiles:

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>


> ---

>  drivers/gpu/drm/tegra/dpaux.c | 2 --

>  drivers/gpu/drm/tegra/drm.h   | 2 +-

>  drivers/gpu/drm/tegra/hdmi.c  | 1 -

>  drivers/gpu/drm/tegra/sor.c   | 1 -

>  4 files changed, 1 insertion(+), 5 deletions(-)

> 

> diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c

> index 7dfb50f65067..105fb9cdbb3b 100644

> --- a/drivers/gpu/drm/tegra/dpaux.c

> +++ b/drivers/gpu/drm/tegra/dpaux.c

> @@ -5,12 +5,10 @@

>  

>  #include <linux/clk.h>

>  #include <linux/delay.h>

> -#include <linux/gpio.h>

>  #include <linux/interrupt.h>

>  #include <linux/io.h>

>  #include <linux/module.h>

>  #include <linux/of_device.h>

> -#include <linux/of_gpio.h>

>  #include <linux/pinctrl/pinconf-generic.h>

>  #include <linux/pinctrl/pinctrl.h>

>  #include <linux/pinctrl/pinmux.h>

> diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h

> index ed99b67deb29..bf0512177e8f 100644

> --- a/drivers/gpu/drm/tegra/drm.h

> +++ b/drivers/gpu/drm/tegra/drm.h

> @@ -9,7 +9,7 @@

>  

>  #include <linux/host1x.h>

>  #include <linux/iova.h>

> -#include <linux/of_gpio.h>

> +#include <linux/gpio/consumer.h>

>  

>  #include <drm/drm_atomic.h>

>  #include <drm/drm_edid.h>

> diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c

> index 38252c0f068d..94fb0193fa3d 100644

> --- a/drivers/gpu/drm/tegra/hdmi.c

> +++ b/drivers/gpu/drm/tegra/hdmi.c

> @@ -7,7 +7,6 @@

>  #include <linux/clk.h>

>  #include <linux/debugfs.h>

>  #include <linux/delay.h>

> -#include <linux/gpio.h>

>  #include <linux/hdmi.h>

>  #include <linux/math64.h>

>  #include <linux/module.h>

> diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c

> index 81226a4953c1..b010826e86da 100644

> --- a/drivers/gpu/drm/tegra/sor.c

> +++ b/drivers/gpu/drm/tegra/sor.c

> @@ -6,7 +6,6 @@

>  #include <linux/clk.h>

>  #include <linux/clk-provider.h>

>  #include <linux/debugfs.h>

> -#include <linux/gpio.h>

>  #include <linux/io.h>

>  #include <linux/module.h>

>  #include <linux/of_device.h>

> -- 

> 2.25.2

> 

> _______________________________________________

> dri-devel mailing list

> dri-devel@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/dri-devel


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thierry Reding April 21, 2020, 10:15 p.m. | #2
On Wed, Apr 15, 2020 at 02:24:27PM +0200, Linus Walleij wrote:
> The Tegra DRM drivers includes the legacy GPIO headers

> <linux/gpio.h> and <linux/of_gpio.h> but what it really

> uses is <linux/gpio/consumer.h> since only gpio_desc

> structs are ever referenced.

> 

> Include the right header on the top level tegra/drm.h

> file and drop all the surplus includes.

> 

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

> ---

>  drivers/gpu/drm/tegra/dpaux.c | 2 --

>  drivers/gpu/drm/tegra/drm.h   | 2 +-

>  drivers/gpu/drm/tegra/hdmi.c  | 1 -

>  drivers/gpu/drm/tegra/sor.c   | 1 -

>  4 files changed, 1 insertion(+), 5 deletions(-)


Applied, thanks.

Thierry
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Linus Walleij April 22, 2020, 3:25 p.m. | #3
On Wed, Apr 22, 2020 at 12:15 AM Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Wed, Apr 15, 2020 at 02:24:27PM +0200, Linus Walleij wrote:

> > The Tegra DRM drivers includes the legacy GPIO headers

> > <linux/gpio.h> and <linux/of_gpio.h> but what it really

> > uses is <linux/gpio/consumer.h> since only gpio_desc

> > structs are ever referenced.

> >

> > Include the right header on the top level tegra/drm.h

> > file and drop all the surplus includes.

> >

> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

> > ---

> >  drivers/gpu/drm/tegra/dpaux.c | 2 --

> >  drivers/gpu/drm/tegra/drm.h   | 2 +-

> >  drivers/gpu/drm/tegra/hdmi.c  | 1 -

> >  drivers/gpu/drm/tegra/sor.c   | 1 -

> >  4 files changed, 1 insertion(+), 5 deletions(-)

>

> Applied, thanks.


I think I already applied it to the drm misc tree the other day,
sorry if that wasn't clear. If tegra has a separate tree I suppose
git will figure it all out in the end.

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch

diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
index 7dfb50f65067..105fb9cdbb3b 100644
--- a/drivers/gpu/drm/tegra/dpaux.c
+++ b/drivers/gpu/drm/tegra/dpaux.c
@@ -5,12 +5,10 @@ 
 
 #include <linux/clk.h>
 #include <linux/delay.h>
-#include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
-#include <linux/of_gpio.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index ed99b67deb29..bf0512177e8f 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -9,7 +9,7 @@ 
 
 #include <linux/host1x.h>
 #include <linux/iova.h>
-#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_edid.h>
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 38252c0f068d..94fb0193fa3d 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -7,7 +7,6 @@ 
 #include <linux/clk.h>
 #include <linux/debugfs.h>
 #include <linux/delay.h>
-#include <linux/gpio.h>
 #include <linux/hdmi.h>
 #include <linux/math64.h>
 #include <linux/module.h>
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 81226a4953c1..b010826e86da 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -6,7 +6,6 @@ 
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/debugfs.h>
-#include <linux/gpio.h>
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of_device.h>