diff mbox

[1/8] ARM: shmobile: sh73a0 pinmux platform device cleanup

Message ID 1369645252-3847-2-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Horman May 27, 2013, 9 a.m. UTC
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>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/setup-sh73a0.c |   25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

Comments

Sergei Shtylyov May 27, 2013, 2:13 p.m. UTC | #1
Hello.

On 27-05-2013 13:00, Simon Horman wrote:

> 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>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>   arch/arm/mach-shmobile/setup-sh73a0.c |   25 ++++++-------------------
>   1 file changed, 6 insertions(+), 19 deletions(-)

> diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
> index fdf3894..f8f4261 100644
> --- a/arch/arm/mach-shmobile/setup-sh73a0.c
> +++ b/arch/arm/mach-shmobile/setup-sh73a0.c
> @@ -61,29 +61,16 @@ void __init sh73a0_map_io(void)
[...]
> +/* PFC */
> +static const struct resource pfc_resources[] = {

    Should have been annotated as __initdata... too late, need another 
patch.

> +	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));
>   }

WBR, Sergei
Olof Johansson May 28, 2013, 4:02 a.m. UTC | #2
On Mon, May 27, 2013 at 06:13:22PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 27-05-2013 13:00, Simon Horman wrote:
> 
> >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>
> >Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> >  arch/arm/mach-shmobile/setup-sh73a0.c |   25 ++++++-------------------
> >  1 file changed, 6 insertions(+), 19 deletions(-)
> 
> >diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
> >index fdf3894..f8f4261 100644
> >--- a/arch/arm/mach-shmobile/setup-sh73a0.c
> >+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
> >@@ -61,29 +61,16 @@ void __init sh73a0_map_io(void)
> [...]
> >+/* PFC */
> >+static const struct resource pfc_resources[] = {
> 
>    Should have been annotated as __initdata... too late, need
> another patch.

See comments on other patches/pull requests, I think there's time to revisit
this. I.e. I'll hold off on pulling this based on the other feedback.


-Olof
Simon Horman June 4, 2013, 5:20 a.m. UTC | #3
On Mon, May 27, 2013 at 09:02:43PM -0700, Olof Johansson wrote:
> On Mon, May 27, 2013 at 06:13:22PM +0400, Sergei Shtylyov wrote:
> > Hello.
> > 
> > On 27-05-2013 13:00, Simon Horman wrote:
> > 
> > >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>
> > >Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > >---
> > >  arch/arm/mach-shmobile/setup-sh73a0.c |   25 ++++++-------------------
> > >  1 file changed, 6 insertions(+), 19 deletions(-)
> > 
> > >diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
> > >index fdf3894..f8f4261 100644
> > >--- a/arch/arm/mach-shmobile/setup-sh73a0.c
> > >+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
> > >@@ -61,29 +61,16 @@ void __init sh73a0_map_io(void)
> > [...]
> > >+/* PFC */
> > >+static const struct resource pfc_resources[] = {
> > 
> >    Should have been annotated as __initdata... too late, need
> > another patch.
> 
> See comments on other patches/pull requests, I think there's time to revisit
> this. I.e. I'll hold off on pulling this based on the other feedback.

As I am respining I will fix this.

However, it had been reviewed and I think that ordinarily
it would be reasonable to perform further clean-up
work in a subsequent patch.
Simon Horman June 4, 2013, 1:20 p.m. UTC | #4
On Tue, Jun 04, 2013 at 02:20:43PM +0900, Simon Horman wrote:
> On Mon, May 27, 2013 at 09:02:43PM -0700, Olof Johansson wrote:
> > On Mon, May 27, 2013 at 06:13:22PM +0400, Sergei Shtylyov wrote:
> > > Hello.
> > > 
> > > On 27-05-2013 13:00, Simon Horman wrote:
> > > 
> > > >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>
> > > >Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > > >---
> > > >  arch/arm/mach-shmobile/setup-sh73a0.c |   25 ++++++-------------------
> > > >  1 file changed, 6 insertions(+), 19 deletions(-)
> > > 
> > > >diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
> > > >index fdf3894..f8f4261 100644
> > > >--- a/arch/arm/mach-shmobile/setup-sh73a0.c
> > > >+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
> > > >@@ -61,29 +61,16 @@ void __init sh73a0_map_io(void)
> > > [...]
> > > >+/* PFC */
> > > >+static const struct resource pfc_resources[] = {
> > > 
> > >    Should have been annotated as __initdata... too late, need
> > > another patch.
> > 
> > See comments on other patches/pull requests, I think there's time to revisit
> > this. I.e. I'll hold off on pulling this based on the other feedback.
> 
> As I am respining I will fix this.
> 
> However, it had been reviewed and I think that ordinarily
> it would be reasonable to perform further clean-up
> work in a subsequent patch.

I decided to simply drop the patch and revisit it later.
Laurent Pinchart June 10, 2013, 12:31 p.m. UTC | #5
Hi Simon,

On Tuesday 04 June 2013 22:20:59 Simon Horman wrote:
> On Tue, Jun 04, 2013 at 02:20:43PM +0900, Simon Horman wrote:
> > On Mon, May 27, 2013 at 09:02:43PM -0700, Olof Johansson wrote:
> > > On Mon, May 27, 2013 at 06:13:22PM +0400, Sergei Shtylyov wrote:
> > > > On 27-05-2013 13:00, Simon Horman wrote:
> > > > >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>
> > > > >Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > > > >---
> > > > >
> > > > >  arch/arm/mach-shmobile/setup-sh73a0.c |   25
> > > > >  ++++++-------------------
> > > > >  1 file changed, 6 insertions(+), 19 deletions(-)
> > > > >
> > > > >diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c
> > > > >b/arch/arm/mach-shmobile/setup-sh73a0.c index fdf3894..f8f4261
> > > > >100644
> > > > >--- a/arch/arm/mach-shmobile/setup-sh73a0.c
> > > > >+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
> > > > >@@ -61,29 +61,16 @@ void __init sh73a0_map_io(void)
> > > > 
> > > > [...]
> > > > 
> > > > >+/* PFC */
> > > > >+static const struct resource pfc_resources[] = {
> > > > >
> > > >    Should have been annotated as __initdata... too late, need
> > > > 
> > > > another patch.
> > > 
> > > See comments on other patches/pull requests, I think there's time to
> > > revisit this. I.e. I'll hold off on pulling this based on the other
> > > feedback.
> >
> > As I am respining I will fix this.
> > 
> > However, it had been reviewed and I think that ordinarily
> > it would be reasonable to perform further clean-up
> > work in a subsequent patch.
> 
> I decided to simply drop the patch and revisit it later.

This patch (as well as the sh7372 equivalent) is pretty simple. What about 
just adding __initdata and resubmitting them ? Otherwise they will get lost.
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index fdf3894..f8f4261 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -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 = {