From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 02/04] ARM: shmobile: r8a7779 pinmux platform device cleanup
Date: Thu, 04 Apr 2013 10:15:36 +0000 [thread overview]
Message-ID: <3291720.vtipCVFTtu@avalon> (raw)
In-Reply-To: <20130403063308.2500.76867.sendpatchset@w520>
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
WARNING: multiple messages have this Message-ID (diff)
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/04] ARM: shmobile: r8a7779 pinmux platform device cleanup
Date: Thu, 04 Apr 2013 12:15:36 +0200 [thread overview]
Message-ID: <3291720.vtipCVFTtu@avalon> (raw)
In-Reply-To: <20130403063308.2500.76867.sendpatchset@w520>
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
next prev parent reply other threads:[~2013-04-04 10:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
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:32 ` [PATCH 01/04] ARM: shmobile: r8a7740 pinmux platform device cleanup Magnus Damm
2013-04-03 6:32 ` Magnus Damm
2013-04-03 6:33 ` [PATCH 02/04] ARM: shmobile: r8a7779 " Magnus Damm
2013-04-03 6:33 ` Magnus Damm
2013-04-04 10:15 ` Laurent Pinchart [this message]
2013-04-04 10:15 ` Laurent Pinchart
2013-04-03 6:33 ` [PATCH 03/04] ARM: shmobile: sh7372 " Magnus Damm
2013-04-03 6:33 ` Magnus Damm
2013-04-03 6:33 ` [PATCH 04/04] ARM: shmobile: sh73a0 " 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 6:24 ` Simon Horman
2013-04-04 10:24 ` Laurent Pinchart
2013-04-04 10:24 ` Laurent Pinchart
2013-04-05 2:07 ` Simon Horman
2013-04-05 2:07 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3291720.vtipCVFTtu@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.