* [PATCH] gpio: clps711x: localise <mach/gpio.h> header
@ 2012-10-15 19:40 Linus Walleij
2012-10-15 20:04 ` Alexander Shiyan
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-10-15 19:40 UTC (permalink / raw)
To: linux-arm-kernel
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 <shc_work@mail.ru>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
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
diff --git a/arch/arm/mach-clps711x/include/mach/gpio.h b/arch/arm/mach-clps711x/include/mach/gpio.h
deleted file mode 100644
index 8ac6889..0000000
--- a/arch/arm/mach-clps711x/include/mach/gpio.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * This file contains the CLPS711X GPIO definitions.
- *
- * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
- *
- * 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))
diff --git a/drivers/gpio/gpio-clps711x.c b/drivers/gpio/gpio-clps711x.c
index ea21822..604b8ba 100644
--- a/drivers/gpio/gpio-clps711x.c
+++ b/drivers/gpio/gpio-clps711x.c
@@ -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];
--
1.7.11.7
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] gpio: clps711x: localise <mach/gpio.h> header
2012-10-15 19:40 [PATCH] gpio: clps711x: localise <mach/gpio.h> header Linus Walleij
@ 2012-10-15 20:04 ` Alexander Shiyan
2012-10-15 20:36 ` Linus Walleij
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shiyan @ 2012-10-15 20:04 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 15 Oct 2012 21:40:20 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:
> 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.
...
> -/* 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.
--
Alexander Shiyan <shc_work@mail.ru>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] gpio: clps711x: localise <mach/gpio.h> header
2012-10-15 20:04 ` Alexander Shiyan
@ 2012-10-15 20:36 ` Linus Walleij
2012-10-15 20:47 ` Alexander Shiyan
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-10-15 20:36 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Oct 15, 2012 at 10:04 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
> On Mon, 15 Oct 2012 21:40:20 +0200
> Linus Walleij <linus.walleij@linaro.org> wrote:
>
>> 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.
> ...
>> -/* 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] gpio: clps711x: localise <mach/gpio.h> header
2012-10-15 20:36 ` Linus Walleij
@ 2012-10-15 20:47 ` Alexander Shiyan
2012-10-15 21:36 ` Arnd Bergmann
2012-10-19 9:58 ` Linus Walleij
0 siblings, 2 replies; 7+ messages in thread
From: Alexander Shiyan @ 2012-10-15 20:47 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 15 Oct 2012 22:36:32 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Oct 15, 2012 at 10:04 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
> > On Mon, 15 Oct 2012 21:40:20 +0200
> > Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> >> 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.
> > ...
> >> -/* 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/*>.
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/*.
--
Alexander Shiyan <shc_work@mail.ru>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] gpio: clps711x: localise <mach/gpio.h> header
2012-10-15 20:47 ` Alexander Shiyan
@ 2012-10-15 21:36 ` Arnd Bergmann
2012-10-16 4:17 ` Alexander Shiyan
2012-10-19 9:58 ` Linus Walleij
1 sibling, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2012-10-15 21:36 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 15 October 2012, Alexander Shiyan wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] gpio: clps711x: localise <mach/gpio.h> header
2012-10-15 21:36 ` Arnd Bergmann
@ 2012-10-16 4:17 ` Alexander Shiyan
0 siblings, 0 replies; 7+ messages in thread
From: Alexander Shiyan @ 2012-10-16 4:17 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 15 Oct 2012 21:36:26 +0000
Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 15 October 2012, Alexander Shiyan wrote:
> > 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.
--
Alexander Shiyan <shc_work@mail.ru>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] gpio: clps711x: localise <mach/gpio.h> header
2012-10-15 20:47 ` Alexander Shiyan
2012-10-15 21:36 ` Arnd Bergmann
@ 2012-10-19 9:58 ` Linus Walleij
1 sibling, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-10-19 9:58 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Oct 15, 2012 at 10:47 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
>> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-10-19 9:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-15 19:40 [PATCH] gpio: clps711x: localise <mach/gpio.h> header Linus Walleij
2012-10-15 20:04 ` Alexander Shiyan
2012-10-15 20:36 ` Linus Walleij
2012-10-15 20:47 ` Alexander Shiyan
2012-10-15 21:36 ` Arnd Bergmann
2012-10-16 4:17 ` Alexander Shiyan
2012-10-19 9:58 ` Linus Walleij
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).