Skip to contentSkip to conversation

sh-pfc: Don't include mach/*.h headers were not required

PATCH New Laurent Pinchart 3 participants 6 messages Jul 24, 2013

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

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
#1 lore raw

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
index 82bf6ab..2b9c0b3 100644
@@ -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
index f6ea47c..6a7d382 100644
@@ -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
index 6dfb187..1528693 100644
@@ -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
#2 lore raw

PATCH 2/3 sh-pfc: sh7372: Replace <mach/irqs.h> with <linux/sh_intc.h>

In reply to Laurent Pinchart

The 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
index 1528693..5a0b445 100644
@@ -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
#3 lore raw

PATCH 3/3 sh-pfc: sh73a0: Remove EXT_IRQ16L and EXT_IRQ16H macros

In reply to Laurent Pinchart

The 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
index 7956df5..d2e8168 100644
@@ -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
#4 lore raw

cover sh-pfc: Don't include mach/*.h headers were not required

In reply to Laurent Pinchart

Hi 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 the irq_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: Remove EXT_IRQ16L and EXT_IRQ16H macros

These are fine with me. Thanks for your help!

#5 lore raw

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 the irq_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: Remove EXT_IRQ16L and EXT_IRQ16H macros

These are fine with me. Thanks for your help!

Thank you.

Signature · 3 lines
Regards,

Laurent Pinchart