diff mbox series

pinctrl: rza2: Include the appropriate headers

Message ID 20190820104252.8255-1-linus.walleij@linaro.org
State Superseded
Headers show
Series pinctrl: rza2: Include the appropriate headers | expand

Commit Message

Linus Walleij Aug. 20, 2019, 10:42 a.m. UTC
This driver is implementing a GPIO driver so include
<linux/gpio/driver.h> and not the legacy API <linux/gpio.h>.
When testing it turns out it also relies on implicit
inclusion of <linux/io.h> (readw etc) so make sure to
include that as well.

Cc: Chris Brandt <chris.brandt@renesas.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
Geert: assuming you will pick this up if you're happy
with it.
---
 drivers/pinctrl/pinctrl-rza2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.21.0

Comments

Geert Uytterhoeven Aug. 20, 2019, 11:05 a.m. UTC | #1
Hi Linus,

On Tue, Aug 20, 2019 at 12:44 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> This driver is implementing a GPIO driver so include

> <linux/gpio/driver.h> and not the legacy API <linux/gpio.h>.

> When testing it turns out it also relies on implicit

> inclusion of <linux/io.h> (readw etc) so make sure to

> include that as well.

>

> Cc: Chris Brandt <chris.brandt@renesas.com>

> Cc: Geert Uytterhoeven <geert+renesas@glider.be>

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

> ---

> Geert: assuming you will pick this up if you're happy

> with it.


Unfortunately shmobile_defconfig is not happy with it:

drivers/pinctrl/pinctrl-rza2.c: In function ‘rza2_pin_to_gpio’:
drivers/pinctrl/pinctrl-rza2.c:119:13: error: ‘GPIOF_DIR_IN’
undeclared (first use in this function); did you mean ‘_IOC_DIRBITS’?
drivers/pinctrl/pinctrl-rza2.c:119:13: note: each undeclared
identifier is reported only once for each function it appears in
drivers/pinctrl/pinctrl-rza2.c: In function ‘rza2_chip_get_direction’:
drivers/pinctrl/pinctrl-rza2.c:138:10: error: ‘GPIOF_DIR_OUT’
undeclared (first use in this function); did you mean ‘IOC_INOUT’?
drivers/pinctrl/pinctrl-rza2.c:141:10: error: ‘GPIOF_DIR_IN’
undeclared (first use in this function); did you mean ‘GPIOF_DIR_OUT’?
drivers/pinctrl/pinctrl-rza2.c: In function ‘rza2_chip_direction_input’:
drivers/pinctrl/pinctrl-rza2.c:157:39: error: ‘GPIOF_DIR_IN’
undeclared (first use in this function); did you mean ‘_IOC_DIRBITS’?
drivers/pinctrl/pinctrl-rza2.c: In function ‘rza2_chip_direction_output’:
drivers/pinctrl/pinctrl-rza2.c:195:39: error: ‘GPIOF_DIR_OUT’
undeclared (first use in this function); did you mean ‘IOC_INOUT’?

Are there prerequisites? It even fails on gpio/for-next.

> --- a/drivers/pinctrl/pinctrl-rza2.c

> +++ b/drivers/pinctrl/pinctrl-rza2.c

> @@ -11,7 +11,8 @@

>   */

>

>  #include <linux/bitops.h>

> -#include <linux/gpio.h>

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

> +#include <linux/io.h>

>  #include <linux/module.h>

>  #include <linux/of_device.h>

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


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
Linus Walleij Aug. 20, 2019, 1:22 p.m. UTC | #2
On Tue, Aug 20, 2019 at 1:05 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Tue, Aug 20, 2019 at 12:44 PM Linus Walleij <linus.walleij@linaro.org> wrote:

> > This driver is implementing a GPIO driver so include

> > <linux/gpio/driver.h> and not the legacy API <linux/gpio.h>.

> > When testing it turns out it also relies on implicit

> > inclusion of <linux/io.h> (readw etc) so make sure to

> > include that as well.

> >

> > Cc: Chris Brandt <chris.brandt@renesas.com>

> > Cc: Geert Uytterhoeven <geert+renesas@glider.be>

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

> > ---

> > Geert: assuming you will pick this up if you're happy

> > with it.

>

> Unfortunately shmobile_defconfig is not happy with it:

>

> drivers/pinctrl/pinctrl-rza2.c: In function ‘rza2_pin_to_gpio’:

> drivers/pinctrl/pinctrl-rza2.c:119:13: error: ‘GPIOF_DIR_IN’


Oh drivers should not use these defines.

OK I spin a v2 fixing that too, no problem.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-rza2.c b/drivers/pinctrl/pinctrl-rza2.c
index 5b951c7422cc..a39e1c35724e 100644
--- a/drivers/pinctrl/pinctrl-rza2.c
+++ b/drivers/pinctrl/pinctrl-rza2.c
@@ -11,7 +11,8 @@ 
  */
 
 #include <linux/bitops.h>
-#include <linux/gpio.h>
+#include <linux/gpio/driver.h>
+#include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/pinctrl/pinmux.h>