gpio: clps711x: localise <mach/gpio.h> header
Subsystems (3)
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.
--- 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
@@ -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
@@ -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
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]>
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
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]>
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 overloadinclude/linux/*.
Can't the board files just call the gpio functions?
Arnd
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 overloadinclude/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]>
PATCH 1/1 gpio: clps711x: localise <mach/gpio.h> header
In reply to Alexander ShiyanQuoted 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 overloadinclude/linux/*.
Sure. That's even better.
Yours,
Linus Walleij