sh-pfc: Don't include mach/*.h headers were not required
Subsystems (2)
cover sh-pfc: Don't include mach/*.h headers were not required
Hello,
The (long) road to multiplatform kernels requires getting rid of mach/*.h headers in device drivers. This patch set removes some of the included mach headers from the sh-pfc driver. The only remaining one is mach/irqs.h, to get the irq_pin() macro. This will require more work, see [1] for a discussion of the issue.
The patches are based on v3.11-rc2. Linus, do you usually pick pinctrl patches from the list, or should I send you a pull request ?
[1] http://www.mail-archive.com/linux-kernel at vger.kernel.org/msg473450.html
Laurent Pinchart (3):
sh-pfc: Remove unneeded mach/<soc>.h includes
sh-pfc: sh7372: Replace <mach/irqs.h> with <linux/sh_intc.h>
sh-pfc: sh73a0: Remove EXT_IRQ16L and EXT_IRQ16H macros
drivers/pinctrl/sh-pfc/pfc-r8a73a4.c | 1 - drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 1 - drivers/pinctrl/sh-pfc/pfc-sh7372.c | 4 +-- drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 68 +++++++++++++++++------------------- 4 files changed, 33 insertions(+), 41 deletions(-)
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 1/3 sh-pfc: Remove unneeded mach/<soc>.h includes
The SoC-specific mach/<soc>.h headers are included needlesly. Don't include them.
--- drivers/pinctrl/sh-pfc/pfc-r8a73a4.c | 1 - drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 1 - drivers/pinctrl/sh-pfc/pfc-sh7372.c | 1 - 3 files changed, 3 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a73a4.c +0 -1
@@ -21,7 +21,6 @@#include <linux/kernel.h> #include <linux/pinctrl/pinconf-generic.h> #include <mach/irqs.h> -#include <mach/r8a73a4.h> #include "core.h" #include "sh_pfc.h"
drivers/pinctrl/sh-pfc/pfc-r8a7740.c +0 -1
@@ -22,7 +22,6 @@#include <linux/kernel.h> #include <linux/pinctrl/pinconf-generic.h> -#include <mach/r8a7740.h> #include <mach/irqs.h> #include "core.h"
drivers/pinctrl/sh-pfc/pfc-sh7372.c +0 -1
@@ -25,7 +25,6 @@#include <linux/pinctrl/pinconf-generic.h> #include <mach/irqs.h> -#include <mach/sh7372.h> #include "core.h" #include "sh_pfc.h"
Signature · 1 line
1.8.1.5
PATCH 2/3 sh-pfc: sh7372: Replace <mach/irqs.h> with <linux/sh_intc.h>
In reply to Laurent PinchartThe mach/irqs.h header is included only to get the evt2irq macro definition. The macro is defined in linux/sh_intc.h, include it directly instead of the mach-specific header.
--- drivers/pinctrl/sh-pfc/pfc-sh7372.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pfc-sh7372.c +1 -2
@@ -23,8 +23,7 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/pinctrl/pinconf-generic.h> - -#include <mach/irqs.h> +#include <linux/sh_intc.h> #include "core.h" #include "sh_pfc.h"
Signature · 1 line
1.8.1.5
PATCH 3/3 sh-pfc: sh73a0: Remove EXT_IRQ16L and EXT_IRQ16H macros
In reply to Laurent PinchartThe macros expand to irq_pin() calls and where most probably introduced from a copy&paste of the sh7372 PFC data. Replace them with irq_pin().
--- drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 68 +++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 36 deletions(-)
drivers/pinctrl/sh-pfc/pfc-sh73a0.c +32 -36
@@ -3674,43 +3674,39 @@ static const struct pinmux_data_reg pinmux_data_regs[] = { { }, }; -/* External IRQ pins mapped at IRQPIN_BASE */ -#define EXT_IRQ16L (n) irq_pin(n) -#define EXT_IRQ16H (n) irq_pin(n) -static const struct pinmux_irq pinmux_irqs[] = { -PINMUX_IRQ (EXT_IRQ16H (19 ),9 ), -PINMUX_IRQ (EXT_IRQ16L (1 ),10 ), -PINMUX_IRQ (EXT_IRQ16L (0 ),11 ), -PINMUX_IRQ (EXT_IRQ16H (18 ),13 ), -PINMUX_IRQ (EXT_IRQ16H (20 ),14 ), -PINMUX_IRQ (EXT_IRQ16H (21 ),15 ), -PINMUX_IRQ (EXT_IRQ16H (31 ),26 ), -PINMUX_IRQ (EXT_IRQ16H (30 ),27 ), -PINMUX_IRQ (EXT_IRQ16H (29 ),28 ), -PINMUX_IRQ (EXT_IRQ16H (22 ),40 ), -PINMUX_IRQ (EXT_IRQ16H (23 ),53 ), -PINMUX_IRQ (EXT_IRQ16L (10 ),54 ), -PINMUX_IRQ (EXT_IRQ16L (9 ),56 ), -PINMUX_IRQ (EXT_IRQ16H (26 ),115 ), -PINMUX_IRQ (EXT_IRQ16H (27 ),116 ), -PINMUX_IRQ (EXT_IRQ16H (28 ),117 ), -PINMUX_IRQ (EXT_IRQ16H (24 ),118 ), -PINMUX_IRQ (EXT_IRQ16L (6 ),147 ), -PINMUX_IRQ (EXT_IRQ16L (2 ),149 ), -PINMUX_IRQ (EXT_IRQ16L (7 ),150 ), -PINMUX_IRQ (EXT_IRQ16L (12 ),156 ), -PINMUX_IRQ (EXT_IRQ16L (4 ),159 ), -PINMUX_IRQ (EXT_IRQ16H (25 ),164 ), -PINMUX_IRQ (EXT_IRQ16L (8 ),223 ), -PINMUX_IRQ (EXT_IRQ16L (3 ),224 ), -PINMUX_IRQ (EXT_IRQ16L (5 ),227 ), -PINMUX_IRQ (EXT_IRQ16H (17 ),234 ), -PINMUX_IRQ (EXT_IRQ16L (11 ),238 ), -PINMUX_IRQ (EXT_IRQ16L (13 ),239 ), -PINMUX_IRQ (EXT_IRQ16H (16 ),249 ), -PINMUX_IRQ (EXT_IRQ16L (14 ),251 ), -PINMUX_IRQ (EXT_IRQ16L (9 ),308 ), +PINMUX_IRQ (irq_pin (19 ),9 ), +PINMUX_IRQ (irq_pin (1 ),10 ), +PINMUX_IRQ (irq_pin (0 ),11 ), +PINMUX_IRQ (irq_pin (18 ),13 ), +PINMUX_IRQ (irq_pin (20 ),14 ), +PINMUX_IRQ (irq_pin (21 ),15 ), +PINMUX_IRQ (irq_pin (31 ),26 ), +PINMUX_IRQ (irq_pin (30 ),27 ), +PINMUX_IRQ (irq_pin (29 ),28 ), +PINMUX_IRQ (irq_pin (22 ),40 ), +PINMUX_IRQ (irq_pin (23 ),53 ), +PINMUX_IRQ (irq_pin (10 ),54 ), +PINMUX_IRQ (irq_pin (9 ),56 ), +PINMUX_IRQ (irq_pin (26 ),115 ), +PINMUX_IRQ (irq_pin (27 ),116 ), +PINMUX_IRQ (irq_pin (28 ),117 ), +PINMUX_IRQ (irq_pin (24 ),118 ), +PINMUX_IRQ (irq_pin (6 ),147 ), +PINMUX_IRQ (irq_pin (2 ),149 ), +PINMUX_IRQ (irq_pin (7 ),150 ), +PINMUX_IRQ (irq_pin (12 ),156 ), +PINMUX_IRQ (irq_pin (4 ),159 ), +PINMUX_IRQ (irq_pin (25 ),164 ), +PINMUX_IRQ (irq_pin (8 ),223 ), +PINMUX_IRQ (irq_pin (3 ),224 ), +PINMUX_IRQ (irq_pin (5 ),227 ), +PINMUX_IRQ (irq_pin (17 ),234 ), +PINMUX_IRQ (irq_pin (11 ),238 ), +PINMUX_IRQ (irq_pin (13 ),239 ), +PINMUX_IRQ (irq_pin (16 ),249 ), +PINMUX_IRQ (irq_pin (14 ),251 ), +PINMUX_IRQ (irq_pin (9 ),308 ), };/* -----------------------------------------------------------------------------
Signature · 1 line
1.8.1.5
cover sh-pfc: Don't include mach/*.h headers were not required
In reply to Laurent PinchartHi Laurent,
Quoted 7 lines · Laurent Pinchart
Hello,
The (long) road to multiplatform kernels requires getting rid of mach/*.h headers in device drivers. This patch set removes some of the included mach headers from the sh-pfc driver. The only remaining one is
mach/irqs.h, to get theirq_pin()macro. This will require more work, see [1] for a discussion of the issue.
That's a blocker for some of the SoCs, right? I suppose the ones using a separate GPIO controller are OK as-is?
Quoted 9 lines
The patches are based on v3.11-rc2. Linus, do you usually pick pinctrl patches from the list, or should I send you a pull request ?
[1] http://www.mail-archive.com/linux-kernel at vger.kernel.org/msg473450.html
Laurent Pinchart (3):
sh-pfc: Remove unneeded mach/<soc>.h includes
sh-pfc: sh7372: Replace <mach/irqs.h> with <linux/sh_intc.h>
sh-pfc: sh73a0: RemoveEXT_IRQ16LandEXT_IRQ16Hmacros
These are fine with me. Thanks for your help!
cover sh-pfc: Don't include mach/*.h headers were not required
Hi Magnus,
Quoted 11 lines · On Wednesday 24 July 2013 23:44:05 Magnus Damm wrote:
Quoted 7 lines · Laurent Pinchart
Hello,
The (long) road to multiplatform kernels requires getting rid of mach/*.h headers in device drivers. This patch set removes some of the included mach headers from the sh-pfc driver. The only remaining one is
mach/irqs.h, to get theirq_pin()macro. This will require more work, see
[1] for a discussion of the issue.That's a blocker for some of the SoCs, right? I suppose the ones using a separate GPIO controller are OK as-is?
Yes. It's a multiplatform blocker for r8a73a4, r8a7740 and sh73a0. SoCs using a separate GPIO controller are fine (although the same problem might pop up for future SoCs with a separate GPIO controller if the GPIO IRQs are handled by a device separate from the GPIO controller).
Quoted 6 lines
Quoted 6 lines
The patches are based on v3.11-rc2. Linus, do you usually pick pinctrl patches from the list, or should I send you a pull request ?
[1]
http://www.mail-archive.com/linux-kernel at vger.kernel.org/msg473450.html
Quoted 8 lines
Quoted 4 lines
Laurent Pinchart (3):
sh-pfc: Remove unneeded mach/<soc>.h includes
sh-pfc: sh7372: Replace <mach/irqs.h> with <linux/sh_intc.h>
sh-pfc: sh73a0: RemoveEXT_IRQ16LandEXT_IRQ16HmacrosThese are fine with me. Thanks for your help!
Acked-by Magnus Damm <[email protected]>
Thank you.
Signature · 3 lines
Regards, Laurent Pinchart