* [PATCH 01/04] ARM: shmobile: r8a7740 pinmux platform device cleanup
2013-04-03 6:32 [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Magnus Damm
@ 2013-04-03 6:32 ` Magnus Damm
2013-04-03 6:33 ` [PATCH 02/04] ARM: shmobile: r8a7779 " Magnus Damm
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Magnus Damm @ 2013-04-03 6:32 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Use DEFINE_RES_MEM() and platform_device_register_simple()
to save a couple of lines of code.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/setup-r8a7740.c | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
--- 0001/arch/arm/mach-shmobile/setup-r8a7740.c
+++ work/arch/arm/mach-shmobile/setup-r8a7740.c 2013-04-03 15:01:50.000000000 +0900
@@ -70,29 +70,15 @@ void __init r8a7740_map_io(void)
}
/* PFC */
-static struct resource r8a7740_pfc_resources[] = {
- [0] = {
- .start = 0xe6050000,
- .end = 0xe6057fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0xe605800c,
- .end = 0xe605802b,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device r8a7740_pfc_device = {
- .name = "pfc-r8a7740",
- .id = -1,
- .resource = r8a7740_pfc_resources,
- .num_resources = ARRAY_SIZE(r8a7740_pfc_resources),
+static const struct resource pfc_resources[] = {
+ DEFINE_RES_MEM(0xe6050000, 0x8000),
+ DEFINE_RES_MEM(0xe605800c, 0x0020),
};
void __init r8a7740_pinmux_init(void)
{
- platform_device_register(&r8a7740_pfc_device);
+ platform_device_register_simple("pfc-r8a7740", -1, pfc_resources,
+ ARRAY_SIZE(pfc_resources));
}
static struct renesas_intc_irqpin_config irqpin0_platform_data = {
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 02/04] ARM: shmobile: r8a7779 pinmux platform device cleanup
2013-04-03 6:32 [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Magnus Damm
2013-04-03 6:32 ` [PATCH 01/04] ARM: shmobile: r8a7740 pinmux platform device cleanup Magnus Damm
@ 2013-04-03 6:33 ` Magnus Damm
2013-04-04 10:15 ` Laurent Pinchart
2013-04-03 6:33 ` [PATCH 03/04] ARM: shmobile: sh7372 " Magnus Damm
` (3 subsequent siblings)
5 siblings, 1 reply; 9+ messages in thread
From: Magnus Damm @ 2013-04-03 6:33 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Use DEFINE_RES_MEM() to save a couple of lines of code.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/setup-r8a7779.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
--- 0001/arch/arm/mach-shmobile/setup-r8a7779.c
+++ work/arch/arm/mach-shmobile/setup-r8a7779.c 2013-04-03 15:30:16.000000000 +0900
@@ -63,12 +63,8 @@ void __init r8a7779_map_io(void)
iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc));
}
-static struct resource r8a7779_pfc_resources[] = {
- [0] = {
- .start = 0xfffc0000,
- .end = 0xfffc023b,
- .flags = IORESOURCE_MEM,
- },
+static const struct resource r8a7779_pfc_resources[] = {
+ DEFINE_RES_MEM(0xfffc0000, 0x023c),
};
static struct platform_device r8a7779_pfc_device = {
@@ -80,15 +76,8 @@ static struct platform_device r8a7779_pf
#define R8A7779_GPIO(idx, npins) \
static struct resource r8a7779_gpio##idx##_resources[] = { \
- [0] = { \
- .start = 0xffc40000 + 0x1000 * (idx), \
- .end = 0xffc4002b + 0x1000 * (idx), \
- .flags = IORESOURCE_MEM, \
- }, \
- [1] = { \
- .start = gic_iid(0xad + (idx)), \
- .flags = IORESOURCE_IRQ, \
- } \
+ DEFINE_RES_MEM(0xffc40000 + (0x1000 * (idx)), 0x002c), \
+ DEFINE_RES_IRQ(gic_iid(0xad + (idx))), \
}; \
\
static struct gpio_rcar_config r8a7779_gpio##idx##_platform_data = { \
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 02/04] ARM: shmobile: r8a7779 pinmux platform device cleanup
2013-04-03 6:33 ` [PATCH 02/04] ARM: shmobile: r8a7779 " Magnus Damm
@ 2013-04-04 10:15 ` Laurent Pinchart
0 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2013-04-04 10:15 UTC (permalink / raw)
To: linux-arm-kernel
Hi Magnus,
Thanks for the patch.
On Wednesday 03 April 2013 15:33:08 Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
>
> Use DEFINE_RES_MEM() to save a couple of lines of code.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
>
> arch/arm/mach-shmobile/setup-r8a7779.c | 19 ++++---------------
> 1 file changed, 4 insertions(+), 15 deletions(-)
>
> --- 0001/arch/arm/mach-shmobile/setup-r8a7779.c
> +++ work/arch/arm/mach-shmobile/setup-r8a7779.c 2013-04-03
> 15:30:16.000000000 +0900 @@ -63,12 +63,8 @@ void __init
> r8a7779_map_io(void)
> iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc));
> }
>
> -static struct resource r8a7779_pfc_resources[] = {
> - [0] = {
> - .start = 0xfffc0000,
> - .end = 0xfffc023b,
> - .flags = IORESOURCE_MEM,
> - },
> +static const struct resource r8a7779_pfc_resources[] = {
> + DEFINE_RES_MEM(0xfffc0000, 0x023c),
This generates a compilation warning, as the resources pointer in struct
platform_device isn't const.
> };
>
> static struct platform_device r8a7779_pfc_device = {
> @@ -80,15 +76,8 @@ static struct platform_device r8a7779_pf
>
> #define R8A7779_GPIO(idx, npins) \
> static struct resource r8a7779_gpio##idx##_resources[] = { \
> - [0] = { \
> - .start = 0xffc40000 + 0x1000 * (idx), \
> - .end = 0xffc4002b + 0x1000 * (idx), \
> - .flags = IORESOURCE_MEM, \
> - }, \
> - [1] = { \
> - .start = gic_iid(0xad + (idx)), \
> - .flags = IORESOURCE_IRQ, \
> - } \
> + DEFINE_RES_MEM(0xffc40000 + (0x1000 * (idx)), 0x002c), \
> + DEFINE_RES_IRQ(gic_iid(0xad + (idx))), \
> }; \
> \
> static struct gpio_rcar_config r8a7779_gpio##idx##_platform_data = { \
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 03/04] ARM: shmobile: sh7372 pinmux platform device cleanup
2013-04-03 6:32 [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Magnus Damm
2013-04-03 6:32 ` [PATCH 01/04] ARM: shmobile: r8a7740 pinmux platform device cleanup Magnus Damm
2013-04-03 6:33 ` [PATCH 02/04] ARM: shmobile: r8a7779 " Magnus Damm
@ 2013-04-03 6:33 ` Magnus Damm
2013-04-03 6:33 ` [PATCH 04/04] ARM: shmobile: sh73a0 " Magnus Damm
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Magnus Damm @ 2013-04-03 6:33 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Use DEFINE_RES_MEM() and platform_device_register_simple()
to save a couple of lines of code.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/setup-sh7372.c | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
--- 0001/arch/arm/mach-shmobile/setup-sh7372.c
+++ work/arch/arm/mach-shmobile/setup-sh7372.c 2013-04-03 15:17:30.000000000 +0900
@@ -62,29 +62,15 @@ void __init sh7372_map_io(void)
}
/* PFC */
-static struct resource sh7372_pfc_resources[] = {
- [0] = {
- .start = 0xe6050000,
- .end = 0xe6057fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0xe605800c,
- .end = 0xe6058027,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device sh7372_pfc_device = {
- .name = "pfc-sh7372",
- .id = -1,
- .resource = sh7372_pfc_resources,
- .num_resources = ARRAY_SIZE(sh7372_pfc_resources),
+static const struct resource pfc_resources[] = {
+ DEFINE_RES_MEM(0xe6050000, 0x8000),
+ DEFINE_RES_MEM(0xe605800c, 0x001c),
};
void __init sh7372_pinmux_init(void)
{
- platform_device_register(&sh7372_pfc_device);
+ platform_device_register_simple("pfc-sh7372", -1, pfc_resources,
+ ARRAY_SIZE(pfc_resources));
}
/* SCIFA0 */
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 04/04] ARM: shmobile: sh73a0 pinmux platform device cleanup
2013-04-03 6:32 [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Magnus Damm
` (2 preceding siblings ...)
2013-04-03 6:33 ` [PATCH 03/04] ARM: shmobile: sh7372 " Magnus Damm
@ 2013-04-03 6:33 ` Magnus Damm
2013-04-04 6:24 ` [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Simon Horman
2013-04-04 10:24 ` Laurent Pinchart
5 siblings, 0 replies; 9+ messages in thread
From: Magnus Damm @ 2013-04-03 6:33 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Use DEFINE_RES_MEM() and platform_device_register_simple()
to save a couple of lines of code.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/setup-sh73a0.c | 25 ++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)
--- 0001/arch/arm/mach-shmobile/setup-sh73a0.c
+++ work/arch/arm/mach-shmobile/setup-sh73a0.c 2013-04-03 15:19:37.000000000 +0900
@@ -61,29 +61,16 @@ void __init sh73a0_map_io(void)
iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
}
-static struct resource sh73a0_pfc_resources[] = {
- [0] = {
- .start = 0xe6050000,
- .end = 0xe6057fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0xe605801c,
- .end = 0xe6058027,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device sh73a0_pfc_device = {
- .name = "pfc-sh73a0",
- .id = -1,
- .resource = sh73a0_pfc_resources,
- .num_resources = ARRAY_SIZE(sh73a0_pfc_resources),
+/* PFC */
+static const struct resource pfc_resources[] = {
+ DEFINE_RES_MEM(0xe6050000, 0x8000),
+ DEFINE_RES_MEM(0xe605801c, 0x000c),
};
void __init sh73a0_pinmux_init(void)
{
- platform_device_register(&sh73a0_pfc_device);
+ platform_device_register_simple("pfc-sh73a0", -1, pfc_resources,
+ ARRAY_SIZE(pfc_resources));
}
static struct plat_sci_port scif0_platform_data = {
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups
2013-04-03 6:32 [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Magnus Damm
` (3 preceding siblings ...)
2013-04-03 6:33 ` [PATCH 04/04] ARM: shmobile: sh73a0 " Magnus Damm
@ 2013-04-04 6:24 ` Simon Horman
2013-04-04 10:24 ` Laurent Pinchart
5 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2013-04-04 6:24 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 03, 2013 at 03:32:46PM +0900, Magnus Damm wrote:
> ARM: shmobile: pinmux platform device cleanups
>
> [PATCH 01/04] ARM: shmobile: r8a7740 pinmux platform device cleanup
> [PATCH 02/04] ARM: shmobile: r8a7779 pinmux platform device cleanup
> [PATCH 03/04] ARM: shmobile: sh7372 pinmux platform device cleanup
> [PATCH 04/04] ARM: shmobile: sh73a0 pinmux platform device cleanup
>
> This series simply cleans up the pinmux platform device handling
> to save a couple of lines. Compile time tested on each SoC.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
Laurent, could you review this series?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups
2013-04-03 6:32 [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Magnus Damm
` (4 preceding siblings ...)
2013-04-04 6:24 ` [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups Simon Horman
@ 2013-04-04 10:24 ` Laurent Pinchart
2013-04-05 2:07 ` Simon Horman
5 siblings, 1 reply; 9+ messages in thread
From: Laurent Pinchart @ 2013-04-04 10:24 UTC (permalink / raw)
To: linux-arm-kernel
Hi Magnus,
Thanks for the patches.
On Wednesday 03 April 2013 15:32:46 Magnus Damm wrote:
> ARM: shmobile: pinmux platform device cleanups
>
> [PATCH 01/04] ARM: shmobile: r8a7740 pinmux platform device cleanup
> [PATCH 02/04] ARM: shmobile: r8a7779 pinmux platform device cleanup
> [PATCH 03/04] ARM: shmobile: sh7372 pinmux platform device cleanup
> [PATCH 04/04] ARM: shmobile: sh73a0 pinmux platform device cleanup
>
> This series simply cleans up the pinmux platform device handling
> to save a couple of lines. Compile time tested on each SoC.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
Except for 2/4,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>
> Written against renesas-next-20130403 in renesas.git
>
> arch/arm/mach-shmobile/setup-r8a7740.c | 24 +++++-------------------
> arch/arm/mach-shmobile/setup-r8a7779.c | 19 ++++---------------
> arch/arm/mach-shmobile/setup-sh7372.c | 24 +++++-------------------
> arch/arm/mach-shmobile/setup-sh73a0.c | 25 ++++++-------------------
> 4 files changed, 20 insertions(+), 72 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 00/04] ARM: shmobile: pinmux platform device cleanups
2013-04-04 10:24 ` Laurent Pinchart
@ 2013-04-05 2:07 ` Simon Horman
0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2013-04-05 2:07 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Apr 04, 2013 at 12:24:15PM +0200, Laurent Pinchart wrote:
> Hi Magnus,
>
> Thanks for the patches.
>
> On Wednesday 03 April 2013 15:32:46 Magnus Damm wrote:
> > ARM: shmobile: pinmux platform device cleanups
> >
> > [PATCH 01/04] ARM: shmobile: r8a7740 pinmux platform device cleanup
> > [PATCH 02/04] ARM: shmobile: r8a7779 pinmux platform device cleanup
> > [PATCH 03/04] ARM: shmobile: sh7372 pinmux platform device cleanup
> > [PATCH 04/04] ARM: shmobile: sh73a0 pinmux platform device cleanup
> >
> > This series simply cleans up the pinmux platform device handling
> > to save a couple of lines. Compile time tested on each SoC.
> >
> > Signed-off-by: Magnus Damm <damm@opensource.se>
>
> Except for 2/4,
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Thanks.
1/4: queued up in soc-r8a7740 branch
3/4: queued up in soc-sh7372 branch
4/4: queued up in soc-sh73a0 branch
> > ---
> >
> > Written against renesas-next-20130403 in renesas.git
> >
> > arch/arm/mach-shmobile/setup-r8a7740.c | 24 +++++-------------------
> > arch/arm/mach-shmobile/setup-r8a7779.c | 19 ++++---------------
> > arch/arm/mach-shmobile/setup-sh7372.c | 24 +++++-------------------
> > arch/arm/mach-shmobile/setup-sh73a0.c | 25 ++++++-------------------
> > 4 files changed, 20 insertions(+), 72 deletions(-)
^ permalink raw reply [flat|nested] 9+ messages in thread