Skip to contentSkip to conversation

gpio: clps711x: localise <mach/gpio.h> header

PATCH New Linus Walleij 3 participants 7 messages Oct 15, 2012 – Oct 19, 2012

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

PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header

The commit adding the CLPS711x driver also added <mach/gpio.h> to the CLPS711x, and we want to get rid of all <mach/*> headers for the future. It turns out that the one macro defined in the file was only used in the GPIO driver itself, so just delete it and copy the macro into the driver.

Cc Alexander Shiyan <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Russell King <[email protected]>
---
 arch/arm/mach-clps711x/include/mach/gpio.h | 13 -------------
 drivers/gpio/gpio-clps711x.c               |  1 +
 2 files changed, 1 insertion(+), 13 deletions(-)
 delete mode 100644 arch/arm/mach-clps711x/include/mach/gpio.h
arch/arm/mach-clps711x/include/mach/gpio.h deleted +0 -13
deleted file mode 100644
index 8ac6889..0000000
@@ -1,13 +0,0 @@
-/*
- *  This file contains the CLPS711X GPIO definitions.
- *
- *  Copyright (C) 2012 Alexander Shiyan <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-/* Simple helper for convert port & pin to GPIO number */
-#define CLPS711X_GPIO(port, bit)	((port) * 8 + (bit))
drivers/gpio/gpio-clps711x.c +1 -0
index ea21822..604b8ba 100644
@@ -20,6 +20,7 @@
 
 #define CLPS711X_GPIO_PORTS	5
 #define CLPS711X_GPIO_NAME	"gpio-clps711x"
+#define CLPS711X_GPIO(port, bit)	((port) * 8 + (bit))
 
 struct clps711x_gpio {
 	struct gpio_chip	chip[CLPS711X_GPIO_PORTS];
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header

Quoted 5 lines · On Mon, 15 Oct 2012 21:40:20 +0200 Linus Walleij <[email protected]>…

The commit adding the CLPS711x driver also added <mach/gpio.h> to the CLPS711x, and we want to get rid of all <mach/*> headers for the future. It turns out that the one macro defined in the file was only used in the GPIO driver itself, so just delete it and copy the macro into the driver.

...

arch/arm/mach-clps711x/include/mach/gpio.h line 13

Quoted 2 lines
arch/arm/mach-clps711x/include/mach/gpio.h deleted +0 -2
-/* Simple helper for convert port & pin to GPIO number */
-#define CLPS711X_GPIO(port, bit)	((port) * 8 + (bit))

...

This macro is not used by driver and was be designed especially for future easy modify existing drivers that use GPIO to gpio-driver.

Signature · 1 line
Alexander Shiyan <[email protected]>
#2 lore raw

PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header

Quoted 8 lines · Alexander Shiyan
Quoted 5 lines · On Mon, 15 Oct 2012 21:40:20 +0200 Linus Walleij <[email protected]>…

The commit adding the CLPS711x driver also added <mach/gpio.h> to the CLPS711x, and we want to get rid of all <mach/*> headers for the future. It turns out that the one macro defined in the file was only used in the GPIO driver itself, so just delete it and copy the macro into the driver.

Quoted 6 lines

...

arch/arm/mach-clps711x/include/mach/gpio.h line 13

Quoted 2 lines
arch/arm/mach-clps711x/include/mach/gpio.h deleted +0 -2
-/* Simple helper for convert port & pin to GPIO number */
-#define CLPS711X_GPIO(port, bit)     ((port) * 8 + (bit))

This macro is not used by driver and was be designed especially for future easy modify existing drivers that use GPIO to gpio-driver.

Then I will delete it for now (see separate patch).

If we shall have a file with macros used like that it needs to atleast be something like <linux/platform_data/gpio-clps711x.h>

We don't want to add new files to <mach/*>.

Yours,
Linus Walleij

#3 lore raw

PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header

Quoted 16 lines · On Mon, 15 Oct 2012 22:36:32 +0200 Linus Walleij <[email protected]>…
Quoted 8 lines · Alexander Shiyan
Quoted 5 lines · On Mon, 15 Oct 2012 21:40:20 +0200 Linus Walleij <[email protected]>…

The commit adding the CLPS711x driver also added <mach/gpio.h> to the CLPS711x, and we want to get rid of all <mach/*> headers for the future. It turns out that the one macro defined in the file was only used in the GPIO driver itself, so just delete it and copy the macro into the driver.

Quoted 6 lines

...

arch/arm/mach-clps711x/include/mach/gpio.h line 13

Quoted 2 lines
arch/arm/mach-clps711x/include/mach/gpio.h deleted +0 -2
-/* Simple helper for convert port & pin to GPIO number */
-#define CLPS711X_GPIO(port, bit)     ((port) * 8 + (bit))

This macro is not used by driver and was be designed especially for future easy modify existing drivers that use GPIO to gpio-driver.

Quoted 7 lines

Then I will delete it for now (see separate patch).

If we shall have a file with macros used like that it needs to atleast be something like <linux/platform_data/gpio-clps711x.h>

We don't want to add new files to <mach/*>.

OK, but since it will be used only in board code, I reintroduce it in arch/arm/mach-clps711x/common.h. On my opinion is no reason to overload include/linux/*.

Signature · 1 line
Alexander Shiyan <[email protected]>
#4 lore raw

PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header

Quoted 3 lines · Alexander Shiyan

OK, but since it will be used only in board code, I reintroduce it in arch/arm/mach-clps711x/common.h. On my opinion is no reason to overload include/linux/*.

Can't the board files just call the gpio functions?

Arnd

#5 lore raw

PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header

Quoted 6 lines · On Mon, 15 Oct 2012 21:36:26 +0000 Arnd Bergmann <[email protected]> wrote:
Quoted 3 lines · Alexander Shiyan

OK, but since it will be used only in board code, I reintroduce it in arch/arm/mach-clps711x/common.h. On my opinion is no reason to overload include/linux/*.

Can't the board files just call the gpio functions?

Yes we can. And we will do so.
Macro is a helper and used only to get the desired GPIO-number.

Signature · 1 line
Alexander Shiyan <[email protected]>
#6 lore raw

PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header

In reply to Alexander Shiyan
Quoted 4 lines · Alexander Shiyan
Quoted 1 line

We don't want to add new files to <mach/*>.

OK, but since it will be used only in board code, I reintroduce it in arch/arm/mach-clps711x/common.h. On my opinion is no reason to overload include/linux/*.

Sure. That's even better.

Yours,
Linus Walleij