All of lore.kernel.org
 help / color / mirror / Atom feed
* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-06-30 16:12 ` Huang Shijie-B32955
  0 siblings, 0 replies; 47+ messages in thread
From: Huang Shijie-B32955 @ 2011-06-30 16:12 UTC (permalink / raw)
  To: Arnd Bergmann, linux-arm-kernel
  Cc: s.hauer, w.sang, thierry.nolf.barco, linux-mtd, u.kleine-koenig, LW

Hi Arnd:

On Thursday 30 June 2011, Huang Shijie wrote:
> add GPMI-NFC support for imx23 and imx28.
>
> Signed-off-by: Huang Shijie <b32955@freescale.com>

>This needs a better changelog, please at least spell out what GPMI-NFC means.
>I'm probably not the only one who gets confused into reading this as
>'near field communication' instead of 'nand flash controller'.

=============================================
thanks.
I will add more information in the following version.


=============================================

>Could you rename this all into gpmi-nand or gpmi-flash instead, to avoid
>confusion when you add support for near field communication?

==========================================
This is a nand flash controller driver.

I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
==========================================

> +#define RES_MEM(soc, _id, _s, _n)                            \
> +     {                                                       \
> +             .start = soc ##_## _id ## _BASE_ADDR,           \
> +             .end   = soc ##_## _id ## _BASE_ADDR + (_s) - 1,\
> +             .name  = (_n),                                  \
> +             .flags = IORESOURCE_MEM,                        \
> +     }
> +
> +#define RES_IRQ(soc, _id, _n)                        \
> +     {                                       \
> +             .start = soc ##_INT_## _id,     \
> +             .end   = soc ##_INT_## _id,     \
> +             .name  = (_n),                  \
> +             .flags = IORESOURCE_IRQ,        \
> +     }
> +
> +#define RES_DMA(soc, _i_s, _i_e, _n)         \
> +     {                                       \
> +             .start = soc ##_## _i_s,        \
> +             .end   = soc ##_## _i_e,        \
> +             .name  = (_n),                  \
> +             .flags = IORESOURCE_DMA,        \
> +     }

>I know that you didn't start this pattern, but I find these macros
>extremely annoying. It obscures the use of the macros with the
>string concatenation and the macro names are way too generic
>for something platform specific. If people think it's a good idea
>to have these, please submit a patch to add macros (without the
>string concatenation) into include/linux/ioport.h.

>Until then, better spell out the resources.

==============================================
I ever tried several methods,  but  I can not find a better method to
replace the current method.

It's annoying, but it really saves some lines.

==============================================


> +/**
> + * struct gpmi_nfc_platform_data - GPMI NFC driver platform data.
> + *
> + * This structure communicates platform-specific information to the GPMI NFC
> + * driver that can't be expressed as resources.
> + *
> + * @platform_init:           A pointer to a function the driver will call to
> + *                           initialize the platform (e.g., set up the pin mux).
> + * @platform_exit:           A pointer to a function the driver will call to
> + *                           exit the platform (e.g., free pins).
> + * @min_prop_delay_in_ns:    Minimum propagation delay of GPMI signals to and
> + *                           from the NAND Flash device, in nanoseconds.
> + * @max_prop_delay_in_ns:    Maximum propagation delay of GPMI signals to and
> + *                           from the NAND Flash device, in nanoseconds.
> + * @max_chip_count:          The maximum number of chips for which the driver
> + *                           should configure the hardware. This value most
> + *                           likely reflects the number of pins that are
> + *                           connected to a NAND Flash device. If this is
> + *                           greater than the SoC hardware can support, the
> + *                           driver will print a message and fail to initialize.
> + * @partitions:              An optional pointer to an array of partition
> + *                           descriptions.
> + * @partition_count:         The number of elements in the partitions array.
> + */
> +struct gpmi_nfc_platform_data {
> +     /* SoC hardware information. */
> +     int             (*platform_init)(void);
> +     void            (*platform_exit)(void);
> +
> +     /* NAND Flash information. */
> +     unsigned int    min_prop_delay_in_ns;
> +     unsigned int    max_prop_delay_in_ns;
> +     unsigned int    max_chip_count;
> +
> +     /* Medium information. */
> +     struct mtd_partition *partitions;
> +     unsigned        partition_count;
> +};

>When adding new infrastructure, always keep in mind how you want it to look
>after the device tree conversion. The partitions and min/max_* are easily covered
>with that, but the init/exit function pointers are somewhat problematic.

>Fortunately, you don't really require these functions for this driver. The _exit
>function is completely unused, so just get rid of it.
===================================================
I am reluctant to remove it, I am not sure whether I will use the _exit() in future.
But, yes, it can be removed now.



Best Regards
Huang Shijie

===================================================

The init function is used only to set up iomux, so the logical replacement is
a pointer to the iomux data, and calling mxs_iomux_setup_multiple_pads
directly from the driver.

        Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-06-30 16:12 ` Huang Shijie-B32955
  0 siblings, 0 replies; 47+ messages in thread
From: Huang Shijie-B32955 @ 2011-06-30 16:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd:

On Thursday 30 June 2011, Huang Shijie wrote:
> add GPMI-NFC support for imx23 and imx28.
>
> Signed-off-by: Huang Shijie <b32955@freescale.com>

>This needs a better changelog, please at least spell out what GPMI-NFC means.
>I'm probably not the only one who gets confused into reading this as
>'near field communication' instead of 'nand flash controller'.

=============================================
thanks.
I will add more information in the following version.


=============================================

>Could you rename this all into gpmi-nand or gpmi-flash instead, to avoid
>confusion when you add support for near field communication?

==========================================
This is a nand flash controller driver.

I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
==========================================

> +#define RES_MEM(soc, _id, _s, _n)                            \
> +     {                                                       \
> +             .start = soc ##_## _id ## _BASE_ADDR,           \
> +             .end   = soc ##_## _id ## _BASE_ADDR + (_s) - 1,\
> +             .name  = (_n),                                  \
> +             .flags = IORESOURCE_MEM,                        \
> +     }
> +
> +#define RES_IRQ(soc, _id, _n)                        \
> +     {                                       \
> +             .start = soc ##_INT_## _id,     \
> +             .end   = soc ##_INT_## _id,     \
> +             .name  = (_n),                  \
> +             .flags = IORESOURCE_IRQ,        \
> +     }
> +
> +#define RES_DMA(soc, _i_s, _i_e, _n)         \
> +     {                                       \
> +             .start = soc ##_## _i_s,        \
> +             .end   = soc ##_## _i_e,        \
> +             .name  = (_n),                  \
> +             .flags = IORESOURCE_DMA,        \
> +     }

>I know that you didn't start this pattern, but I find these macros
>extremely annoying. It obscures the use of the macros with the
>string concatenation and the macro names are way too generic
>for something platform specific. If people think it's a good idea
>to have these, please submit a patch to add macros (without the
>string concatenation) into include/linux/ioport.h.

>Until then, better spell out the resources.

==============================================
I ever tried several methods,  but  I can not find a better method to
replace the current method.

It's annoying, but it really saves some lines.

==============================================


> +/**
> + * struct gpmi_nfc_platform_data - GPMI NFC driver platform data.
> + *
> + * This structure communicates platform-specific information to the GPMI NFC
> + * driver that can't be expressed as resources.
> + *
> + * @platform_init:           A pointer to a function the driver will call to
> + *                           initialize the platform (e.g., set up the pin mux).
> + * @platform_exit:           A pointer to a function the driver will call to
> + *                           exit the platform (e.g., free pins).
> + * @min_prop_delay_in_ns:    Minimum propagation delay of GPMI signals to and
> + *                           from the NAND Flash device, in nanoseconds.
> + * @max_prop_delay_in_ns:    Maximum propagation delay of GPMI signals to and
> + *                           from the NAND Flash device, in nanoseconds.
> + * @max_chip_count:          The maximum number of chips for which the driver
> + *                           should configure the hardware. This value most
> + *                           likely reflects the number of pins that are
> + *                           connected to a NAND Flash device. If this is
> + *                           greater than the SoC hardware can support, the
> + *                           driver will print a message and fail to initialize.
> + * @partitions:              An optional pointer to an array of partition
> + *                           descriptions.
> + * @partition_count:         The number of elements in the partitions array.
> + */
> +struct gpmi_nfc_platform_data {
> +     /* SoC hardware information. */
> +     int             (*platform_init)(void);
> +     void            (*platform_exit)(void);
> +
> +     /* NAND Flash information. */
> +     unsigned int    min_prop_delay_in_ns;
> +     unsigned int    max_prop_delay_in_ns;
> +     unsigned int    max_chip_count;
> +
> +     /* Medium information. */
> +     struct mtd_partition *partitions;
> +     unsigned        partition_count;
> +};

>When adding new infrastructure, always keep in mind how you want it to look
>after the device tree conversion. The partitions and min/max_* are easily covered
>with that, but the init/exit function pointers are somewhat problematic.

>Fortunately, you don't really require these functions for this driver. The _exit
>function is completely unused, so just get rid of it.
===================================================
I am reluctant to remove it, I am not sure whether I will use the _exit() in future.
But, yes, it can be removed now.



Best Regards
Huang Shijie

===================================================

The init function is used only to set up iomux, so the logical replacement is
a pointer to the iomux data, and calling mxs_iomux_setup_multiple_pads
directly from the driver.

        Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
  2011-06-30 16:12 ` Huang Shijie-B32955
@ 2011-06-30 22:29   ` Arnd Bergmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-06-30 22:29 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: s.hauer, w.sang, thierry.nolf.barco, Huang Shijie-B32955,
	linux-mtd, u.kleine-koenig, LW

On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
> 
> I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.

Then how do you want to name the near field communication drivers?

> >I know that you didn't start this pattern, but I find these macros
> >extremely annoying. It obscures the use of the macros with the
> >string concatenation and the macro names are way too generic
> >for something platform specific. If people think it's a good idea
> >to have these, please submit a patch to add macros (without the
> >string concatenation) into include/linux/ioport.h.
> 
> >Until then, better spell out the resources.
> 
> ==============================================
> I ever tried several methods,  but  I can not find a better method to
> replace the current method.
> 
> It's annoying, but it really saves some lines.

It would save more lines if you introduce the macros globally and
convert all existing resource definitions ;-)

Making code shorter is usually a good idea, but not when it conflicts
with readability. Adding custom macros that do string concatenation
is such a case.

> >When adding new infrastructure, always keep in mind how you want it to look
> >after the device tree conversion. The partitions and min/max_* are easily covered
> >with that, but the init/exit function pointers are somewhat problematic.
> 
> >Fortunately, you don't really require these functions for this driver. The _exit
> >function is completely unused, so just get rid of it.
> ===================================================
> I am reluctant to remove it, I am not sure whether I will use the _exit() in future.
> But, yes, it can be removed now.

As a rule, you should never introduce infrastructure just because you might
need it in the future but don't know if you will really need it.

This is even more important for the actual driver, as I mentioned in my other
mail. You have a hardware abstraction layer, but only one variant of the hardware
posted along with the driver. Without seeing different hardware, how should
anyone be able to tell whether the abstraction is really needed or if it's the
correct abstraction?

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-06-30 22:29   ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-06-30 22:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
> 
> I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.

Then how do you want to name the near field communication drivers?

> >I know that you didn't start this pattern, but I find these macros
> >extremely annoying. It obscures the use of the macros with the
> >string concatenation and the macro names are way too generic
> >for something platform specific. If people think it's a good idea
> >to have these, please submit a patch to add macros (without the
> >string concatenation) into include/linux/ioport.h.
> 
> >Until then, better spell out the resources.
> 
> ==============================================
> I ever tried several methods,  but  I can not find a better method to
> replace the current method.
> 
> It's annoying, but it really saves some lines.

It would save more lines if you introduce the macros globally and
convert all existing resource definitions ;-)

Making code shorter is usually a good idea, but not when it conflicts
with readability. Adding custom macros that do string concatenation
is such a case.

> >When adding new infrastructure, always keep in mind how you want it to look
> >after the device tree conversion. The partitions and min/max_* are easily covered
> >with that, but the init/exit function pointers are somewhat problematic.
> 
> >Fortunately, you don't really require these functions for this driver. The _exit
> >function is completely unused, so just get rid of it.
> ===================================================
> I am reluctant to remove it, I am not sure whether I will use the _exit() in future.
> But, yes, it can be removed now.

As a rule, you should never introduce infrastructure just because you might
need it in the future but don't know if you will really need it.

This is even more important for the actual driver, as I mentioned in my other
mail. You have a hardware abstraction layer, but only one variant of the hardware
posted along with the driver. Without seeing different hardware, how should
anyone be able to tell whether the abstraction is really needed or if it's the
correct abstraction?

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
  2011-06-30 22:29   ` Arnd Bergmann
@ 2011-07-01  6:44     ` Uwe Kleine-König
  -1 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-01  6:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: s.hauer, w.sang, thierry.nolf.barco, Huang Shijie-B32955,
	linux-mtd, linux-arm-kernel, LW

Hello,

On Fri, Jul 01, 2011 at 12:29:51AM +0200, Arnd Bergmann wrote:
> On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
> > 
> > I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
> 
> Then how do you want to name the near field communication drivers?
I'm not aware that the i.MX23/28 has support for near field
communication, still the i.MX28 Reference speaks about "GPMI NAND Mode".
I couldn't find "NFC" in the document. So I vote for gpmi-nand, too.
(IMHO gpmi-flash is too generic.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-07-01  6:44     ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-01  6:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Fri, Jul 01, 2011 at 12:29:51AM +0200, Arnd Bergmann wrote:
> On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
> > 
> > I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
> 
> Then how do you want to name the near field communication drivers?
I'm not aware that the i.MX23/28 has support for near field
communication, still the i.MX28 Reference speaks about "GPMI NAND Mode".
I couldn't find "NFC" in the document. So I vote for gpmi-nand, too.
(IMHO gpmi-flash is too generic.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
  2011-06-30 22:29   ` Arnd Bergmann
@ 2011-07-01  8:57     ` Huang Shijie
  -1 siblings, 0 replies; 47+ messages in thread
From: Huang Shijie @ 2011-07-01  8:57 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: s.hauer, w.sang, thierry.nolf.barco, linux-mtd, u.kleine-koenig,
	linux-arm-kernel, LW

hi;
> On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
>> I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
> Then how do you want to name the near field communication drivers?
>
what's meaning of "near field communication" ?

>>> I know that you didn't start this pattern, but I find these macros
>>> extremely annoying. It obscures the use of the macros with the
>>> string concatenation and the macro names are way too generic
>>> for something platform specific. If people think it's a good idea
>>> to have these, please submit a patch to add macros (without the
>>> string concatenation) into include/linux/ioport.h.
>>> Until then, better spell out the resources.
>> ==============================================
>> I ever tried several methods,  but  I can not find a better method to
>> replace the current method.
>>
>> It's annoying, but it really saves some lines.
> It would save more lines if you introduce the macros globally and
> convert all existing resource definitions ;-)
The origin code did not use any macros.
Some one suggested me to use macros.
So i used the macros.

Do i have to drop the macros?



> Making code shorter is usually a good idea, but not when it conflicts
> with readability. Adding custom macros that do string concatenation
> is such a case.
>
>>> When adding new infrastructure, always keep in mind how you want it to look
>>> after the device tree conversion. The partitions and min/max_* are easily covered
>>> with that, but the init/exit function pointers are somewhat problematic.
>>> Fortunately, you don't really require these functions for this driver. The _exit
>>> function is completely unused, so just get rid of it.
>> ===================================================
>> I am reluctant to remove it, I am not sure whether I will use the _exit() in future.
>> But, yes, it can be removed now.
> As a rule, you should never introduce infrastructure just because you might
> need it in the future but don't know if you will really need it.
thanks. I will remove it in next version.

> This is even more important for the actual driver, as I mentioned in my other
> mail. You have a hardware abstraction layer, but only one variant of the hardware
> posted along with the driver. Without seeing different hardware, how should
> anyone be able to tell whether the abstraction is really needed or if it's the
> correct abstraction?
Best Regards
Huang Shijie
> 	Arnd
>

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-07-01  8:57     ` Huang Shijie
  0 siblings, 0 replies; 47+ messages in thread
From: Huang Shijie @ 2011-07-01  8:57 UTC (permalink / raw)
  To: linux-arm-kernel

hi;
> On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
>> I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
> Then how do you want to name the near field communication drivers?
>
what's meaning of "near field communication" ?

>>> I know that you didn't start this pattern, but I find these macros
>>> extremely annoying. It obscures the use of the macros with the
>>> string concatenation and the macro names are way too generic
>>> for something platform specific. If people think it's a good idea
>>> to have these, please submit a patch to add macros (without the
>>> string concatenation) into include/linux/ioport.h.
>>> Until then, better spell out the resources.
>> ==============================================
>> I ever tried several methods,  but  I can not find a better method to
>> replace the current method.
>>
>> It's annoying, but it really saves some lines.
> It would save more lines if you introduce the macros globally and
> convert all existing resource definitions ;-)
The origin code did not use any macros.
Some one suggested me to use macros.
So i used the macros.

Do i have to drop the macros?



> Making code shorter is usually a good idea, but not when it conflicts
> with readability. Adding custom macros that do string concatenation
> is such a case.
>
>>> When adding new infrastructure, always keep in mind how you want it to look
>>> after the device tree conversion. The partitions and min/max_* are easily covered
>>> with that, but the init/exit function pointers are somewhat problematic.
>>> Fortunately, you don't really require these functions for this driver. The _exit
>>> function is completely unused, so just get rid of it.
>> ===================================================
>> I am reluctant to remove it, I am not sure whether I will use the _exit() in future.
>> But, yes, it can be removed now.
> As a rule, you should never introduce infrastructure just because you might
> need it in the future but don't know if you will really need it.
thanks. I will remove it in next version.

> This is even more important for the actual driver, as I mentioned in my other
> mail. You have a hardware abstraction layer, but only one variant of the hardware
> posted along with the driver. Without seeing different hardware, how should
> anyone be able to tell whether the abstraction is really needed or if it's the
> correct abstraction?
Best Regards
Huang Shijie
> 	Arnd
>

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
  2011-07-01  8:57     ` Huang Shijie
@ 2011-07-01  9:09       ` Arnd Bergmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-01  9:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: s.hauer, w.sang, thierry.nolf.barco, Huang Shijie, linux-mtd,
	u.kleine-koenig, LW

On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
> >> It's annoying, but it really saves some lines.
> > It would save more lines if you introduce the macros globally and
> > convert all existing resource definitions ;-)
> The origin code did not use any macros.
> Some one suggested me to use macros.
> So i used the macros.
> 
> Do i have to drop the macros?

Can you find out who made the suggestion? Let's first reach consensus
about how we want to do these things in the future.

My opinion is that we should not have macros like these in any platform
specific code: If the macros are a good idea, we should define them
globally and let everyone use the same macros. If we decide not to have
them in global code, it would be even worse to have them in specific
platforms.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-07-01  9:09       ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-01  9:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
> >> It's annoying, but it really saves some lines.
> > It would save more lines if you introduce the macros globally and
> > convert all existing resource definitions ;-)
> The origin code did not use any macros.
> Some one suggested me to use macros.
> So i used the macros.
> 
> Do i have to drop the macros?

Can you find out who made the suggestion? Let's first reach consensus
about how we want to do these things in the future.

My opinion is that we should not have macros like these in any platform
specific code: If the macros are a good idea, we should define them
globally and let everyone use the same macros. If we decide not to have
them in global code, it would be even worse to have them in specific
platforms.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
  2011-07-01  8:57     ` Huang Shijie
@ 2011-07-01 14:52       ` Arnd Bergmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-01 14:52 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: s.hauer, w.sang, thierry.nolf.barco, Huang Shijie, linux-mtd,
	u.kleine-koenig, LW

On Friday 01 July 2011, Huang Shijie wrote:
> > On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
> >> I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
> > Then how do you want to name the near field communication drivers?
> >
> what's meaning of "near field communication" ?

See http://en.wikipedia.org/wiki/Near_field_communication

It's likely to be present in most future mobile phones. Think of it as
a combination of bluetooth and RFID (oversimplified).

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-07-01 14:52       ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-01 14:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 01 July 2011, Huang Shijie wrote:
> > On Thursday 30 June 2011 18:12:27 Huang Shijie-B32955 wrote:
> >> I think gpmi-nfc is much better then gpmi-nand or gpmi-flash.
> > Then how do you want to name the near field communication drivers?
> >
> what's meaning of "near field communication" ?

See http://en.wikipedia.org/wiki/Near_field_communication

It's likely to be present in most future mobile phones. Think of it as
a combination of bluetooth and RFID (oversimplified).

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
  2011-07-01  9:09       ` Arnd Bergmann
@ 2011-07-07  8:56         ` Huang Shijie
  -1 siblings, 0 replies; 47+ messages in thread
From: Huang Shijie @ 2011-07-07  8:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: s.hauer, w.sang, thierry.nolf.barco, linux-mtd, u.kleine-koenig,
	linux-arm-kernel, LW

Hi:
> On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
>>>> It's annoying, but it really saves some lines.
>>> It would save more lines if you introduce the macros globally and
>>> convert all existing resource definitions ;-)
>> The origin code did not use any macros.
>> Some one suggested me to use macros.
>> So i used the macros.
>>
>> Do i have to drop the macros?
> Can you find out who made the suggestion? Let's first reach consensus
> about how we want to do these things in the future.
http://www.spinics.net/lists/arm-kernel/msg121384.html

Thanks to your comments.


Best Regards
Huang Shijie
> My opinion is that we should not have macros like these in any platform
> specific code: If the macros are a good idea, we should define them
> globally and let everyone use the same macros. If we decide not to have
> them in global code, it would be even worse to have them in specific
> platforms.
>
> 	Arnd
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-07-07  8:56         ` Huang Shijie
  0 siblings, 0 replies; 47+ messages in thread
From: Huang Shijie @ 2011-07-07  8:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi:
> On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
>>>> It's annoying, but it really saves some lines.
>>> It would save more lines if you introduce the macros globally and
>>> convert all existing resource definitions ;-)
>> The origin code did not use any macros.
>> Some one suggested me to use macros.
>> So i used the macros.
>>
>> Do i have to drop the macros?
> Can you find out who made the suggestion? Let's first reach consensus
> about how we want to do these things in the future.
http://www.spinics.net/lists/arm-kernel/msg121384.html

Thanks to your comments.


Best Regards
Huang Shijie
> My opinion is that we should not have macros like these in any platform
> specific code: If the macros are a good idea, we should define them
> globally and let everyone use the same macros. If we decide not to have
> them in global code, it would be even worse to have them in specific
> platforms.
>
> 	Arnd
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
  2011-07-07  8:56         ` Huang Shijie
@ 2011-07-07 15:57           ` Arnd Bergmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-07 15:57 UTC (permalink / raw)
  To: Huang Shijie
  Cc: s.hauer, w.sang, thierry.nolf.barco, linux-mtd, u.kleine-koenig,
	linux-arm-kernel, LW

On Thursday 07 July 2011, Huang Shijie wrote:
> > On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
> >>>> It's annoying, but it really saves some lines.
> >>> It would save more lines if you introduce the macros globally and
> >>> convert all existing resource definitions ;-)
> >> The origin code did not use any macros.
> >> Some one suggested me to use macros.
> >> So i used the macros.
> >>
> >> Do i have to drop the macros?
> > Can you find out who made the suggestion? Let's first reach consensus
> > about how we want to do these things in the future.
> http://www.spinics.net/lists/arm-kernel/msg121384.html
> 

Ok, so Uwe made a rather generic comment that he'd prefer you to use
macros for that part. I think your original code actually looks cleaner
in this case, mostly because it doesn't obfuscate the identifiers
and because the macro is specific to this file.

Uwe, do you think it's worthwhile introducing a global macro for
everyone to use for defining resources? Clearly this is not an
mxs specific problem, and I'd much rather have the same solution
everywhere.

I'm thinking that if we want to solve this, the macro should live
in include/linux/ioport.h along with struct resource.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
@ 2011-07-07 15:57           ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-07 15:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 07 July 2011, Huang Shijie wrote:
> > On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
> >>>> It's annoying, but it really saves some lines.
> >>> It would save more lines if you introduce the macros globally and
> >>> convert all existing resource definitions ;-)
> >> The origin code did not use any macros.
> >> Some one suggested me to use macros.
> >> So i used the macros.
> >>
> >> Do i have to drop the macros?
> > Can you find out who made the suggestion? Let's first reach consensus
> > about how we want to do these things in the future.
> http://www.spinics.net/lists/arm-kernel/msg121384.html
> 

Ok, so Uwe made a rather generic comment that he'd prefer you to use
macros for that part. I think your original code actually looks cleaner
in this case, mostly because it doesn't obfuscate the identifiers
and because the macro is specific to this file.

Uwe, do you think it's worthwhile introducing a global macro for
everyone to use for defining resources? Clearly this is not an
mxs specific problem, and I'd much rather have the same solution
everywhere.

I'm thinking that if we want to solve this, the macro should live
in include/linux/ioport.h along with struct resource.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for?imx23/imx28
  2011-07-07 15:57           ` Arnd Bergmann
@ 2011-07-07 20:48             ` Uwe Kleine-König
  -1 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-07 20:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: s.hauer, w.sang, thierry.nolf.barco, Huang Shijie, linux-mtd,
	linux-arm-kernel, LW

On Thu, Jul 07, 2011 at 05:57:23PM +0200, Arnd Bergmann wrote:
> On Thursday 07 July 2011, Huang Shijie wrote:
> > > On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
> > >>>> It's annoying, but it really saves some lines.
> > >>> It would save more lines if you introduce the macros globally and
> > >>> convert all existing resource definitions ;-)
> > >> The origin code did not use any macros.
> > >> Some one suggested me to use macros.
> > >> So i used the macros.
> > >>
> > >> Do i have to drop the macros?
> > > Can you find out who made the suggestion? Let's first reach consensus
> > > about how we want to do these things in the future.
> > http://www.spinics.net/lists/arm-kernel/msg121384.html
> > 
> 
> Ok, so Uwe made a rather generic comment that he'd prefer you to use
> macros for that part. I think your original code actually looks cleaner
> in this case, mostly because it doesn't obfuscate the identifiers
> and because the macro is specific to this file.
> 
> Uwe, do you think it's worthwhile introducing a global macro for
> everyone to use for defining resources? Clearly this is not an
> mxs specific problem, and I'd much rather have the same solution
> everywhere.
The thing I didn't like in the original code is that there are two
nearly identical data definitions. With the macros introduced here
(one example to ease the discussion:

	#define RES_MEM(soc, _id, _s, _n)				\
		{							\
			.start = soc ##_## _id ## _BASE_ADDR,		\
			.end   = soc ##_## _id ## _BASE_ADDR + (_s) - 1,\
			.name  = (_n),					\
			.flags = IORESOURCE_MEM,			\
		}

)

My thoughts on this is that it should better go to where struct resource
is defined (<linux/ioports.h>, as Arndt suggested) but then probably a
bit more generic as:

	#define RES_MEM_NAMED(_start, _end, _name)			\
		{							\
			.start = _start,				\
			.end = _end,					\
			.name = _name,					\
			.flags = IORESOURCE_MEM,			\
		}
	#define RES_MEM(_start, _end)					\
		RES_MEM_NAMED(_start, _end, NULL)

(Maybe alternatively take a _size parameter instead of _end?)
While this makes the repetition shorter, it's still there.

I thought this could be shrinked down to

	const struct resource res_imx23[] __initconst = something_magic(MX23);
	const struct resource res_imx28[] __initconst = something_magic(MX28);

While this part looks nice, I agree that it's not as easy to understand
(for a human) as the expanded version. Knowing not everybody agrees with
me, I still prefer the shrinked representation.
But as I'm not willing to argue about that: Please use the expanded version
if you prefer it.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for?imx23/imx28
@ 2011-07-07 20:48             ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-07 20:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 07, 2011 at 05:57:23PM +0200, Arnd Bergmann wrote:
> On Thursday 07 July 2011, Huang Shijie wrote:
> > > On Friday 01 July 2011 10:57:40 Huang Shijie wrote:
> > >>>> It's annoying, but it really saves some lines.
> > >>> It would save more lines if you introduce the macros globally and
> > >>> convert all existing resource definitions ;-)
> > >> The origin code did not use any macros.
> > >> Some one suggested me to use macros.
> > >> So i used the macros.
> > >>
> > >> Do i have to drop the macros?
> > > Can you find out who made the suggestion? Let's first reach consensus
> > > about how we want to do these things in the future.
> > http://www.spinics.net/lists/arm-kernel/msg121384.html
> > 
> 
> Ok, so Uwe made a rather generic comment that he'd prefer you to use
> macros for that part. I think your original code actually looks cleaner
> in this case, mostly because it doesn't obfuscate the identifiers
> and because the macro is specific to this file.
> 
> Uwe, do you think it's worthwhile introducing a global macro for
> everyone to use for defining resources? Clearly this is not an
> mxs specific problem, and I'd much rather have the same solution
> everywhere.
The thing I didn't like in the original code is that there are two
nearly identical data definitions. With the macros introduced here
(one example to ease the discussion:

	#define RES_MEM(soc, _id, _s, _n)				\
		{							\
			.start = soc ##_## _id ## _BASE_ADDR,		\
			.end   = soc ##_## _id ## _BASE_ADDR + (_s) - 1,\
			.name  = (_n),					\
			.flags = IORESOURCE_MEM,			\
		}

)

My thoughts on this is that it should better go to where struct resource
is defined (<linux/ioports.h>, as Arndt suggested) but then probably a
bit more generic as:

	#define RES_MEM_NAMED(_start, _end, _name)			\
		{							\
			.start = _start,				\
			.end = _end,					\
			.name = _name,					\
			.flags = IORESOURCE_MEM,			\
		}
	#define RES_MEM(_start, _end)					\
		RES_MEM_NAMED(_start, _end, NULL)

(Maybe alternatively take a _size parameter instead of _end?)
While this makes the repetition shorter, it's still there.

I thought this could be shrinked down to

	const struct resource res_imx23[] __initconst = something_magic(MX23);
	const struct resource res_imx28[] __initconst = something_magic(MX28);

While this part looks nice, I agree that it's not as easy to understand
(for a human) as the expanded version. Knowing not everybody agrees with
me, I still prefer the shrinked representation.
But as I'm not willing to argue about that: Please use the expanded version
if you prefer it.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for?imx23/imx28
  2011-07-07 20:48             ` Uwe Kleine-König
@ 2011-07-07 21:04               ` Arnd Bergmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-07 21:04 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: s.hauer, w.sang, thierry.nolf.barco, Huang Shijie, linux-mtd,
	linux-arm-kernel, LW

On Thursday 07 July 2011 22:48:33 Uwe Kleine-König wrote:
> My thoughts on this is that it should better go to where struct resource
> is defined (<linux/ioports.h>, as Arndt suggested) but then probably a
> bit more generic as:
> 
>         #define RES_MEM_NAMED(_start, _end, _name)                      \
>                 {                                                       \
>                         .start = _start,                                \
>                         .end = _end,                                    \
>                         .name = _name,                                  \
>                         .flags = IORESOURCE_MEM,                        \
>                 }
>         #define RES_MEM(_start, _end)                                   \
>                 RES_MEM_NAMED(_start, _end, NULL)
> 
> (Maybe alternatively take a _size parameter instead of _end?)
> While this makes the repetition shorter, it's still there.
> 

This sounds reasonable, and I'd also prefer the size instead of end
argument here. If you prepare a patch to do this, I can ack it for you.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for?imx23/imx28
@ 2011-07-07 21:04               ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-07 21:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 07 July 2011 22:48:33 Uwe Kleine-K?nig wrote:
> My thoughts on this is that it should better go to where struct resource
> is defined (<linux/ioports.h>, as Arndt suggested) but then probably a
> bit more generic as:
> 
>         #define RES_MEM_NAMED(_start, _end, _name)                      \
>                 {                                                       \
>                         .start = _start,                                \
>                         .end = _end,                                    \
>                         .name = _name,                                  \
>                         .flags = IORESOURCE_MEM,                        \
>                 }
>         #define RES_MEM(_start, _end)                                   \
>                 RES_MEM_NAMED(_start, _end, NULL)
> 
> (Maybe alternatively take a _size parameter instead of _end?)
> While this makes the repetition shorter, it's still there.
> 

This sounds reasonable, and I'd also prefer the size instead of end
argument here. If you prepare a patch to do this, I can ack it for you.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH] new helper to define common struct resource constructs
  2011-07-07 21:04               ` Arnd Bergmann
@ 2011-07-11 14:40                 ` Uwe Kleine-König
  -1 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-11 14:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sascha Hauer, Wolfram Sang, linux-kernel, thierry.nolf.barco,
	Huang Shijie, linux-mtd, Andrew Morton, linux-arm-kernel,
	Lothar Waßmann

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3202 bytes --]

resource definitions that just define start, end and flags = IORESOURCE_MEM
or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
for them. Also make available a macro to specify named resources of both
types which are less common.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

On Thu, 7 Jul 2011 23:04:05 +0200, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 07 July 2011 22:48:33 Uwe Kleine-König wrote:
> > My thoughts on this is that it should better go to where struct resource
> > is defined (<linux/ioports.h>, as Arndt suggested) but then probably a
> > bit more generic as:
> > 
> >         #define RES_MEM_NAMED(_start, _end, _name)                      \
> >                 {                                                       \
> >                         .start = _start,                                \
> >                         .end = _end,                                    \
> >                         .name = _name,                                  \
> >                         .flags = IORESOURCE_MEM,                        \
> >                 }
> >         #define RES_MEM(_start, _end)                                   \
> >                 RES_MEM_NAMED(_start, _end, NULL)
> > 
> > (Maybe alternatively take a _size parameter instead of _end?)
> > While this makes the repetition shorter, it's still there.
> > 
> 
> This sounds reasonable, and I'd also prefer the size instead of end
> argument here. If you prepare a patch to do this, I can ack it for you.
Did that now. In reply to this mail I'll send a patch that converts
arch/arm/plat-mxc/devices to these new helpers which saves ~200 lines.

BTW, this bases on next-20110707. I will coordinate with Sascha and
rebase the follow-up patch accordingly when this one got in.

Best regards
Uwe

 include/linux/ioport.h |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..6d493a1 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,26 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = _start,					\
+		.end = _start + _size - 1,				\
+		.name = _name,						\
+		.flags = _flags,					\
+	}
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED(_irq, 1, _name, IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED(_irq, NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH] new helper to define common struct resource constructs
@ 2011-07-11 14:40                 ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-11 14:40 UTC (permalink / raw)
  To: linux-arm-kernel

resource definitions that just define start, end and flags = IORESOURCE_MEM
or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
for them. Also make available a macro to specify named resources of both
types which are less common.

Signed-off-by: Uwe Kleine-K??nig <u.kleine-koenig@pengutronix.de>
---
Hello,

On Thu, 7 Jul 2011 23:04:05 +0200, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 07 July 2011 22:48:33 Uwe Kleine-K??nig wrote:
> > My thoughts on this is that it should better go to where struct resource
> > is defined (<linux/ioports.h>, as Arndt suggested) but then probably a
> > bit more generic as:
> > 
> >         #define RES_MEM_NAMED(_start, _end, _name)                      \
> >                 {                                                       \
> >                         .start = _start,                                \
> >                         .end = _end,                                    \
> >                         .name = _name,                                  \
> >                         .flags = IORESOURCE_MEM,                        \
> >                 }
> >         #define RES_MEM(_start, _end)                                   \
> >                 RES_MEM_NAMED(_start, _end, NULL)
> > 
> > (Maybe alternatively take a _size parameter instead of _end?)
> > While this makes the repetition shorter, it's still there.
> > 
> 
> This sounds reasonable, and I'd also prefer the size instead of end
> argument here. If you prepare a patch to do this, I can ack it for you.
Did that now. In reply to this mail I'll send a patch that converts
arch/arm/plat-mxc/devices to these new helpers which saves ~200 lines.

BTW, this bases on next-20110707. I will coordinate with Sascha and
rebase the follow-up patch accordingly when this one got in.

Best regards
Uwe

 include/linux/ioport.h |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..6d493a1 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,26 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = _start,					\
+		.end = _start + _size - 1,				\
+		.name = _name,						\
+		.flags = _flags,					\
+	}
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED(_irq, 1, _name, IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED(_irq, NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4

-- 
Pengutronix e.K.                           | Uwe Kleine-K??nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH] ARM: mxc: use new helpers to define common struct resource entries
  2011-07-11 14:40                 ` Uwe Kleine-König
@ 2011-07-11 15:03                   ` Uwe Kleine-König
  -1 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-11 15:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sascha Hauer, Wolfram Sang, linux-kernel, thierry.nolf.barco,
	Huang Shijie, linux-mtd, Andrew Morton, linux-arm-kernel,
	Lothar Waßmann

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-mxc/devices/platform-fec.c           |   11 +----
 arch/arm/plat-mxc/devices/platform-flexcan.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c  |   11 +----
 arch/arm/plat-mxc/devices/platform-gpio-mxc.c      |   16 +------
 arch/arm/plat-mxc/devices/platform-imx-dma.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-fb.c        |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-i2c.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-keypad.c    |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-ssi.c       |   19 ++-------
 arch/arm/plat-mxc/devices/platform-imx-uart.c      |   35 ++++-------------
 arch/arm/plat-mxc/devices/platform-imx2-wdt.c      |    6 +--
 arch/arm/plat-mxc/devices/platform-imx21-hcd.c     |   11 +----
 arch/arm/plat-mxc/devices/platform-imx_udc.c       |   41 ++++----------------
 arch/arm/plat-mxc/devices/platform-imxdi_rtc.c     |   11 +----
 arch/arm/plat-mxc/devices/platform-ipu-core.c      |   33 +++-------------
 arch/arm/plat-mxc/devices/platform-mx1-camera.c    |   11 +----
 arch/arm/plat-mxc/devices/platform-mx2-camera.c    |   21 ++--------
 arch/arm/plat-mxc/devices/platform-mxc-ehci.c      |   11 +----
 arch/arm/plat-mxc/devices/platform-mxc-mmc.c       |   16 +------
 arch/arm/plat-mxc/devices/platform-mxc_nand.c      |   16 +------
 arch/arm/plat-mxc/devices/platform-mxc_pwm.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-mxc_rnga.c      |    6 +--
 arch/arm/plat-mxc/devices/platform-mxc_rtc.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-mxc_w1.c        |    6 +--
 .../plat-mxc/devices/platform-sdhci-esdhc-imx.c    |   11 +----
 arch/arm/plat-mxc/devices/platform-spi_imx.c       |   11 +----
 26 files changed, 72 insertions(+), 308 deletions(-)

diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
index 4fc6ffc..b64f309 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/plat-mxc/devices/platform-fec.c
@@ -52,15 +52,8 @@ struct platform_device *__init imx_add_fec(
 		const struct fec_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_4K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_4K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device_dmamask("fec", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-flexcan.c b/arch/arm/plat-mxc/devices/platform-flexcan.c
index 4e8497a..fcb5873 100644
--- a/arch/arm/plat-mxc/devices/platform-flexcan.c
+++ b/arch/arm/plat-mxc/devices/platform-flexcan.c
@@ -42,15 +42,8 @@ struct platform_device *__init imx_add_flexcan(
 		const struct flexcan_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("flexcan", data->id,
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
index 23ce08e..749c28c 100644
--- a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
+++ b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
@@ -41,15 +41,8 @@ struct platform_device *__init imx_add_fsl_usb2_udc(
 		const struct fsl_usb2_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_512 - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_512),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("fsl-usb2-udc", -1,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c b/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
index cf1b7fd..3314557 100644
--- a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
+++ b/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
@@ -12,19 +12,9 @@ struct platform_device *__init mxc_register_gpio(int id,
 	resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
 {
 	struct resource res[] = {
-		{
-			.start = iobase,
-			.end = iobase + iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = irq,
-			.end = irq,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = irq_high,
-			.end = irq_high,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(iobase, iosize),
+		DEFINE_RES_IRQ(irq),
+		DEFINE_RES_IRQ(irq_high),
 	};
 
 	return platform_device_register_resndata(&mxc_aips_bus,
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c
index 2b0fdb2..90280f0 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-dma.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c
@@ -18,15 +18,8 @@ struct platform_device __init __maybe_unused *imx_add_imx_sdma(
 	resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = iobase,
-			.end = iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = irq,
-			.end = irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(iobase, SZ_16K),
+		DEFINE_RES_IRQ(irq),
 	};
 
 	return platform_device_register_resndata(&mxc_ahb_bus, "imx-sdma",
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/plat-mxc/devices/platform-imx-fb.c
index 2b0b5e0..fe76319 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-fb.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-fb.c
@@ -42,15 +42,8 @@ struct platform_device *__init imx_add_imx_fb(
 		const struct imx_fb_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("imx-fb", 0,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
index afe60f7..d624f73 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
@@ -103,15 +103,8 @@ struct platform_device *__init imx_add_imx_i2c(
 		const struct imxi2c_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("imx-i2c", data->id,
diff --git a/arch/arm/plat-mxc/devices/platform-imx-keypad.c b/arch/arm/plat-mxc/devices/platform-imx-keypad.c
index 479c3e9..573a3a0 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-keypad.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-keypad.c
@@ -56,15 +56,8 @@ struct platform_device *__init imx_add_imx_keypad(
 		const struct matrix_keymap_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("imx-keypad", -1,
diff --git a/arch/arm/plat-mxc/devices/platform-imx-ssi.c b/arch/arm/plat-mxc/devices/platform-imx-ssi.c
index 21c6f30..a8e6c2f 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-ssi.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-ssi.c
@@ -91,21 +91,10 @@ struct platform_device *__init imx_add_imx_ssi(
 		const struct imx_ssi_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
-#define DMARES(_name) {							\
-	.name = #_name,							\
-	.start = data->dma ## _name,					\
-	.end = data->dma ## _name,					\
-	.flags = IORESOURCE_DMA,					\
-}
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
+#define DMARES(_name)	\
+	DEFINE_RES_NAMED(data->dma ## _name, 1, #_name, IORESOURCE_DMA)
 		DMARES(tx0),
 		DMARES(rx0),
 		DMARES(tx1),
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c
index cfce8c9..d3659ad 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-uart.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c
@@ -133,23 +133,10 @@ struct platform_device *__init imx_add_imx_uart_3irq(
 		const struct imxuart_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irqrx,
-			.end = data->irqrx,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irqtx,
-			.end = data->irqtx,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irqrts,
-			.end = data->irqrx,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irqrx),
+		DEFINE_RES_IRQ(data->irqtx),
+		DEFINE_RES_IRQ(data->irqrts),
 	};
 
 	return imx_add_platform_device("imx-uart", data->id, res,
@@ -161,17 +148,11 @@ struct platform_device *__init imx_add_imx_uart_1irq(
 		const struct imxuart_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
-	return imx_add_platform_device("imx-uart", data->id, res, ARRAY_SIZE(res),
+	return imx_add_platform_device("imx-uart", data->id,
+			res, ARRAY_SIZE(res),
 			pdata, sizeof(*pdata));
 }
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
index 5e07ef2..03e81a5 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
@@ -66,11 +66,7 @@ struct platform_device *__init imx_add_imx2_wdt(
 		const struct imx_imx2_wdt_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
 	};
 	return imx_add_platform_device("imx2-wdt", data->id,
 			res, ARRAY_SIZE(res), NULL, 0);
diff --git a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c b/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
index 5770a42..77931cc 100644
--- a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
+++ b/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
@@ -25,15 +25,8 @@ struct platform_device *__init imx_add_imx21_hcd(
 		const struct mx21_usbh_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_8K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_8K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("imx21-hcd", 0,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-imx_udc.c b/arch/arm/plat-mxc/devices/platform-imx_udc.c
index 6fd675d..ad754c7 100644
--- a/arch/arm/plat-mxc/devices/platform-imx_udc.c
+++ b/arch/arm/plat-mxc/devices/platform-imx_udc.c
@@ -35,39 +35,14 @@ struct platform_device *__init imx_add_imx_udc(
 		const struct imxusb_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq0,
-			.end = data->irq0,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq1,
-			.end = data->irq1,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq2,
-			.end = data->irq2,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq3,
-			.end = data->irq3,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq4,
-			.end = data->irq4,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq5,
-			.end = data->irq5,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq6,
-			.end = data->irq6,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq0),
+		DEFINE_RES_IRQ(data->irq1),
+		DEFINE_RES_IRQ(data->irq2),
+		DEFINE_RES_IRQ(data->irq3),
+		DEFINE_RES_IRQ(data->irq4),
+		DEFINE_RES_IRQ(data->irq5),
+		DEFINE_RES_IRQ(data->irq6),
 	};
 
 	return imx_add_platform_device("imx_udc", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
index 805336f..1929153 100644
--- a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
+++ b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
@@ -25,15 +25,8 @@ struct platform_device *__init imx_add_imxdi_rtc(
 		const struct imx_imxdi_rtc_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("imxdi_rtc", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/plat-mxc/devices/platform-ipu-core.c
index 79d340a..0a30c30 100644
--- a/arch/arm/plat-mxc/devices/platform-ipu-core.c
+++ b/arch/arm/plat-mxc/devices/platform-ipu-core.c
@@ -35,23 +35,10 @@ struct platform_device *__init imx_add_ipu_core(
 {
 	/* The resource order is important! */
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + 0x5f,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->iobase + 0x88,
-			.end = data->iobase + 0xb3,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->synirq,
-			.end = data->synirq,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->errirq,
-			.end = data->errirq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, 0x60),
+		DEFINE_RES_MEM(data->iobase + 0x88, 0x2c),
+		DEFINE_RES_IRQ(data->synirq),
+		DEFINE_RES_IRQ(data->errirq),
 	};
 
 	return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1,
@@ -63,11 +50,7 @@ struct platform_device *__init imx_alloc_mx3_camera(
 		const struct mx3_camera_pdata *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase + 0x60,
-			.end = data->iobase + 0x87,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase + 0x60, 0x28);
 	};
 	int ret = -ENOMEM;
 	struct platform_device *pdev;
@@ -112,11 +95,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
 		struct mx3fb_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase + 0xb4,
-			.end = data->iobase + 0x1bf,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase + 0xb4, 0x10c),
 	};
 
 	if (IS_ERR_OR_NULL(imx_ipu_coredev))
diff --git a/arch/arm/plat-mxc/devices/platform-mx1-camera.c b/arch/arm/plat-mxc/devices/platform-mx1-camera.c
index edcc581..61dac5e 100644
--- a/arch/arm/plat-mxc/devices/platform-mx1-camera.c
+++ b/arch/arm/plat-mxc/devices/platform-mx1-camera.c
@@ -26,15 +26,8 @@ struct platform_device *__init imx_add_mx1_camera(
 		const struct mx1_camera_pdata *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("mx1-camera", 0,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
index b3f4828..c167f30 100644
--- a/arch/arm/plat-mxc/devices/platform-mx2-camera.c
+++ b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
@@ -40,23 +40,10 @@ struct platform_device *__init imx_add_mx2_camera(
 		const struct mx2_camera_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobasecsi,
-			.end = data->iobasecsi + data->iosizecsi - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irqcsi,
-			.end = data->irqcsi,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->iobaseemmaprp,
-			.end = data->iobaseemmaprp + data->iosizeemmaprp - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irqemmaprp,
-			.end = data->irqemmaprp,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobasecsi, data->iosizecsi),
+		DEFINE_RES_IRQ(data->irqcsi),
+		DEFINE_RES_MEM(data->iobaseemmaprp, data->iosizeemmaprp),
+		DEFINE_RES_IRQ(data->irqemmaprp),
 	};
 	return imx_add_platform_device_dmamask("mx2-camera", 0,
 			res, data->iobaseemmaprp ? 4 : 2,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
index e1763e0..9eb7b62 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
@@ -54,15 +54,8 @@ struct platform_device *__init imx_add_mxc_ehci(
 		const struct mxc_usbh_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_512 - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_512),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("mxc-ehci", data->id,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
index 540d3a7..b105933 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
@@ -53,19 +53,9 @@ struct platform_device *__init imx_add_mxc_mmc(
 		const struct imxmmc_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_4K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->dmareq,
-			.end = data->dmareq,
-			.flags = IORESOURCE_DMA,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_4K),
+		DEFINE_RES_IRQ(data->irq),
+		DEFINE_RES_NAMED(data->dmareq, 1, NULL, IORESOURCE_DMA),
 	};
 	return imx_add_platform_device_dmamask("mxc-mmc", data->id,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
index 1568f39..3664533 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_nand.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
@@ -62,19 +62,9 @@ struct platform_device *__init imx_add_mxc_nand(
 {
 	/* AXI has to come first, that's how the mxc_nand driver expect it */
 	struct resource res[] = {
-		{
-			.start = data->axibase,
-			.end = data->axibase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->axibase, SZ_16K),
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device("mxc_nand", data->id,
 			res + !data->axibase,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
index b0c4ae2..bcc95ec 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
@@ -53,15 +53,8 @@ struct platform_device *__init imx_add_mxc_pwm(
 		const struct imx_mxc_pwm_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("mxc_pwm", data->id,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
index b4b7612..a4fb661 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
@@ -27,11 +27,7 @@ static struct platform_device *__init imx_add_mxc_rnga(
 		const struct imx_mxc_rnga_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
 	};
 	return imx_add_platform_device("mxc_rnga", -1,
 			res, ARRAY_SIZE(res), NULL, 0);
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
index 16d0ec4..2dd42dc 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
@@ -24,15 +24,8 @@ struct platform_device *__init imx_add_mxc_rtc(
 		const struct imx_mxc_rtc_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("mxc_rtc", -1,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_w1.c b/arch/arm/plat-mxc/devices/platform-mxc_w1.c
index 96fa5ea..72b97ea 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_w1.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_w1.c
@@ -38,11 +38,7 @@ struct platform_device *__init imx_add_mxc_w1(
 		const struct imx_mxc_w1_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_4K - 1,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_4K),
 	};
 
 	return imx_add_platform_device("mxc_w1", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
index 6b2940b..325c2a1 100644
--- a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
+++ b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
@@ -70,15 +70,8 @@ struct platform_device *__init imx_add_sdhci_esdhc_imx(
 		const struct esdhc_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("sdhci-esdhc-imx", data->id, res,
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c
index f97eb36..1b680b4 100644
--- a/arch/arm/plat-mxc/devices/platform-spi_imx.c
+++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c
@@ -107,15 +107,8 @@ struct platform_device *__init imx_add_spi_imx(
 		const struct spi_imx_master *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device(data->devid, data->id,
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH] ARM: mxc: use new helpers to define common struct resource entries
@ 2011-07-11 15:03                   ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-11 15:03 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-mxc/devices/platform-fec.c           |   11 +----
 arch/arm/plat-mxc/devices/platform-flexcan.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c  |   11 +----
 arch/arm/plat-mxc/devices/platform-gpio-mxc.c      |   16 +------
 arch/arm/plat-mxc/devices/platform-imx-dma.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-fb.c        |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-i2c.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-keypad.c    |   11 +----
 arch/arm/plat-mxc/devices/platform-imx-ssi.c       |   19 ++-------
 arch/arm/plat-mxc/devices/platform-imx-uart.c      |   35 ++++-------------
 arch/arm/plat-mxc/devices/platform-imx2-wdt.c      |    6 +--
 arch/arm/plat-mxc/devices/platform-imx21-hcd.c     |   11 +----
 arch/arm/plat-mxc/devices/platform-imx_udc.c       |   41 ++++----------------
 arch/arm/plat-mxc/devices/platform-imxdi_rtc.c     |   11 +----
 arch/arm/plat-mxc/devices/platform-ipu-core.c      |   33 +++-------------
 arch/arm/plat-mxc/devices/platform-mx1-camera.c    |   11 +----
 arch/arm/plat-mxc/devices/platform-mx2-camera.c    |   21 ++--------
 arch/arm/plat-mxc/devices/platform-mxc-ehci.c      |   11 +----
 arch/arm/plat-mxc/devices/platform-mxc-mmc.c       |   16 +------
 arch/arm/plat-mxc/devices/platform-mxc_nand.c      |   16 +------
 arch/arm/plat-mxc/devices/platform-mxc_pwm.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-mxc_rnga.c      |    6 +--
 arch/arm/plat-mxc/devices/platform-mxc_rtc.c       |   11 +----
 arch/arm/plat-mxc/devices/platform-mxc_w1.c        |    6 +--
 .../plat-mxc/devices/platform-sdhci-esdhc-imx.c    |   11 +----
 arch/arm/plat-mxc/devices/platform-spi_imx.c       |   11 +----
 26 files changed, 72 insertions(+), 308 deletions(-)

diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
index 4fc6ffc..b64f309 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/plat-mxc/devices/platform-fec.c
@@ -52,15 +52,8 @@ struct platform_device *__init imx_add_fec(
 		const struct fec_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_4K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_4K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device_dmamask("fec", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-flexcan.c b/arch/arm/plat-mxc/devices/platform-flexcan.c
index 4e8497a..fcb5873 100644
--- a/arch/arm/plat-mxc/devices/platform-flexcan.c
+++ b/arch/arm/plat-mxc/devices/platform-flexcan.c
@@ -42,15 +42,8 @@ struct platform_device *__init imx_add_flexcan(
 		const struct flexcan_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("flexcan", data->id,
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
index 23ce08e..749c28c 100644
--- a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
+++ b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
@@ -41,15 +41,8 @@ struct platform_device *__init imx_add_fsl_usb2_udc(
 		const struct fsl_usb2_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_512 - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_512),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("fsl-usb2-udc", -1,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c b/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
index cf1b7fd..3314557 100644
--- a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
+++ b/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
@@ -12,19 +12,9 @@ struct platform_device *__init mxc_register_gpio(int id,
 	resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
 {
 	struct resource res[] = {
-		{
-			.start = iobase,
-			.end = iobase + iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = irq,
-			.end = irq,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = irq_high,
-			.end = irq_high,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(iobase, iosize),
+		DEFINE_RES_IRQ(irq),
+		DEFINE_RES_IRQ(irq_high),
 	};
 
 	return platform_device_register_resndata(&mxc_aips_bus,
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c
index 2b0fdb2..90280f0 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-dma.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c
@@ -18,15 +18,8 @@ struct platform_device __init __maybe_unused *imx_add_imx_sdma(
 	resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = iobase,
-			.end = iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = irq,
-			.end = irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(iobase, SZ_16K),
+		DEFINE_RES_IRQ(irq),
 	};
 
 	return platform_device_register_resndata(&mxc_ahb_bus, "imx-sdma",
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/plat-mxc/devices/platform-imx-fb.c
index 2b0b5e0..fe76319 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-fb.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-fb.c
@@ -42,15 +42,8 @@ struct platform_device *__init imx_add_imx_fb(
 		const struct imx_fb_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("imx-fb", 0,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
index afe60f7..d624f73 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
@@ -103,15 +103,8 @@ struct platform_device *__init imx_add_imx_i2c(
 		const struct imxi2c_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("imx-i2c", data->id,
diff --git a/arch/arm/plat-mxc/devices/platform-imx-keypad.c b/arch/arm/plat-mxc/devices/platform-imx-keypad.c
index 479c3e9..573a3a0 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-keypad.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-keypad.c
@@ -56,15 +56,8 @@ struct platform_device *__init imx_add_imx_keypad(
 		const struct matrix_keymap_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("imx-keypad", -1,
diff --git a/arch/arm/plat-mxc/devices/platform-imx-ssi.c b/arch/arm/plat-mxc/devices/platform-imx-ssi.c
index 21c6f30..a8e6c2f 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-ssi.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-ssi.c
@@ -91,21 +91,10 @@ struct platform_device *__init imx_add_imx_ssi(
 		const struct imx_ssi_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
-#define DMARES(_name) {							\
-	.name = #_name,							\
-	.start = data->dma ## _name,					\
-	.end = data->dma ## _name,					\
-	.flags = IORESOURCE_DMA,					\
-}
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
+#define DMARES(_name)	\
+	DEFINE_RES_NAMED(data->dma ## _name, 1, #_name, IORESOURCE_DMA)
 		DMARES(tx0),
 		DMARES(rx0),
 		DMARES(tx1),
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c
index cfce8c9..d3659ad 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-uart.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c
@@ -133,23 +133,10 @@ struct platform_device *__init imx_add_imx_uart_3irq(
 		const struct imxuart_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irqrx,
-			.end = data->irqrx,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irqtx,
-			.end = data->irqtx,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irqrts,
-			.end = data->irqrx,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irqrx),
+		DEFINE_RES_IRQ(data->irqtx),
+		DEFINE_RES_IRQ(data->irqrts),
 	};
 
 	return imx_add_platform_device("imx-uart", data->id, res,
@@ -161,17 +148,11 @@ struct platform_device *__init imx_add_imx_uart_1irq(
 		const struct imxuart_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
-	return imx_add_platform_device("imx-uart", data->id, res, ARRAY_SIZE(res),
+	return imx_add_platform_device("imx-uart", data->id,
+			res, ARRAY_SIZE(res),
 			pdata, sizeof(*pdata));
 }
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
index 5e07ef2..03e81a5 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
@@ -66,11 +66,7 @@ struct platform_device *__init imx_add_imx2_wdt(
 		const struct imx_imx2_wdt_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
 	};
 	return imx_add_platform_device("imx2-wdt", data->id,
 			res, ARRAY_SIZE(res), NULL, 0);
diff --git a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c b/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
index 5770a42..77931cc 100644
--- a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
+++ b/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
@@ -25,15 +25,8 @@ struct platform_device *__init imx_add_imx21_hcd(
 		const struct mx21_usbh_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_8K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_8K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("imx21-hcd", 0,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-imx_udc.c b/arch/arm/plat-mxc/devices/platform-imx_udc.c
index 6fd675d..ad754c7 100644
--- a/arch/arm/plat-mxc/devices/platform-imx_udc.c
+++ b/arch/arm/plat-mxc/devices/platform-imx_udc.c
@@ -35,39 +35,14 @@ struct platform_device *__init imx_add_imx_udc(
 		const struct imxusb_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq0,
-			.end = data->irq0,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq1,
-			.end = data->irq1,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq2,
-			.end = data->irq2,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq3,
-			.end = data->irq3,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq4,
-			.end = data->irq4,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq5,
-			.end = data->irq5,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->irq6,
-			.end = data->irq6,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq0),
+		DEFINE_RES_IRQ(data->irq1),
+		DEFINE_RES_IRQ(data->irq2),
+		DEFINE_RES_IRQ(data->irq3),
+		DEFINE_RES_IRQ(data->irq4),
+		DEFINE_RES_IRQ(data->irq5),
+		DEFINE_RES_IRQ(data->irq6),
 	};
 
 	return imx_add_platform_device("imx_udc", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
index 805336f..1929153 100644
--- a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
+++ b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
@@ -25,15 +25,8 @@ struct platform_device *__init imx_add_imxdi_rtc(
 		const struct imx_imxdi_rtc_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("imxdi_rtc", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/plat-mxc/devices/platform-ipu-core.c
index 79d340a..0a30c30 100644
--- a/arch/arm/plat-mxc/devices/platform-ipu-core.c
+++ b/arch/arm/plat-mxc/devices/platform-ipu-core.c
@@ -35,23 +35,10 @@ struct platform_device *__init imx_add_ipu_core(
 {
 	/* The resource order is important! */
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + 0x5f,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->iobase + 0x88,
-			.end = data->iobase + 0xb3,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->synirq,
-			.end = data->synirq,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->errirq,
-			.end = data->errirq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, 0x60),
+		DEFINE_RES_MEM(data->iobase + 0x88, 0x2c),
+		DEFINE_RES_IRQ(data->synirq),
+		DEFINE_RES_IRQ(data->errirq),
 	};
 
 	return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1,
@@ -63,11 +50,7 @@ struct platform_device *__init imx_alloc_mx3_camera(
 		const struct mx3_camera_pdata *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase + 0x60,
-			.end = data->iobase + 0x87,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase + 0x60, 0x28);
 	};
 	int ret = -ENOMEM;
 	struct platform_device *pdev;
@@ -112,11 +95,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
 		struct mx3fb_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase + 0xb4,
-			.end = data->iobase + 0x1bf,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase + 0xb4, 0x10c),
 	};
 
 	if (IS_ERR_OR_NULL(imx_ipu_coredev))
diff --git a/arch/arm/plat-mxc/devices/platform-mx1-camera.c b/arch/arm/plat-mxc/devices/platform-mx1-camera.c
index edcc581..61dac5e 100644
--- a/arch/arm/plat-mxc/devices/platform-mx1-camera.c
+++ b/arch/arm/plat-mxc/devices/platform-mx1-camera.c
@@ -26,15 +26,8 @@ struct platform_device *__init imx_add_mx1_camera(
 		const struct mx1_camera_pdata *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("mx1-camera", 0,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
index b3f4828..c167f30 100644
--- a/arch/arm/plat-mxc/devices/platform-mx2-camera.c
+++ b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
@@ -40,23 +40,10 @@ struct platform_device *__init imx_add_mx2_camera(
 		const struct mx2_camera_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobasecsi,
-			.end = data->iobasecsi + data->iosizecsi - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irqcsi,
-			.end = data->irqcsi,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->iobaseemmaprp,
-			.end = data->iobaseemmaprp + data->iosizeemmaprp - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irqemmaprp,
-			.end = data->irqemmaprp,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobasecsi, data->iosizecsi),
+		DEFINE_RES_IRQ(data->irqcsi),
+		DEFINE_RES_MEM(data->iobaseemmaprp, data->iosizeemmaprp),
+		DEFINE_RES_IRQ(data->irqemmaprp),
 	};
 	return imx_add_platform_device_dmamask("mx2-camera", 0,
 			res, data->iobaseemmaprp ? 4 : 2,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
index e1763e0..9eb7b62 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
@@ -54,15 +54,8 @@ struct platform_device *__init imx_add_mxc_ehci(
 		const struct mxc_usbh_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_512 - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_512),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device_dmamask("mxc-ehci", data->id,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
index 540d3a7..b105933 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
@@ -53,19 +53,9 @@ struct platform_device *__init imx_add_mxc_mmc(
 		const struct imxmmc_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_4K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		}, {
-			.start = data->dmareq,
-			.end = data->dmareq,
-			.flags = IORESOURCE_DMA,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_4K),
+		DEFINE_RES_IRQ(data->irq),
+		DEFINE_RES_NAMED(data->dmareq, 1, NULL, IORESOURCE_DMA),
 	};
 	return imx_add_platform_device_dmamask("mxc-mmc", data->id,
 			res, ARRAY_SIZE(res),
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
index 1568f39..3664533 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_nand.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
@@ -62,19 +62,9 @@ struct platform_device *__init imx_add_mxc_nand(
 {
 	/* AXI has to come first, that's how the mxc_nand driver expect it */
 	struct resource res[] = {
-		{
-			.start = data->axibase,
-			.end = data->axibase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->axibase, SZ_16K),
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 	return imx_add_platform_device("mxc_nand", data->id,
 			res + !data->axibase,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
index b0c4ae2..bcc95ec 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
@@ -53,15 +53,8 @@ struct platform_device *__init imx_add_mxc_pwm(
 		const struct imx_mxc_pwm_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("mxc_pwm", data->id,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
index b4b7612..a4fb661 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
@@ -27,11 +27,7 @@ static struct platform_device *__init imx_add_mxc_rnga(
 		const struct imx_mxc_rnga_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
 	};
 	return imx_add_platform_device("mxc_rnga", -1,
 			res, ARRAY_SIZE(res), NULL, 0);
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
index 16d0ec4..2dd42dc 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
@@ -24,15 +24,8 @@ struct platform_device *__init imx_add_mxc_rtc(
 		const struct imx_mxc_rtc_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("mxc_rtc", -1,
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_w1.c b/arch/arm/plat-mxc/devices/platform-mxc_w1.c
index 96fa5ea..72b97ea 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_w1.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_w1.c
@@ -38,11 +38,7 @@ struct platform_device *__init imx_add_mxc_w1(
 		const struct imx_mxc_w1_data *data)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_4K - 1,
-			.flags = IORESOURCE_MEM,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_4K),
 	};
 
 	return imx_add_platform_device("mxc_w1", 0,
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
index 6b2940b..325c2a1 100644
--- a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
+++ b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
@@ -70,15 +70,8 @@ struct platform_device *__init imx_add_sdhci_esdhc_imx(
 		const struct esdhc_platform_data *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_16K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, SZ_16K),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device("sdhci-esdhc-imx", data->id, res,
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c
index f97eb36..1b680b4 100644
--- a/arch/arm/plat-mxc/devices/platform-spi_imx.c
+++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c
@@ -107,15 +107,8 @@ struct platform_device *__init imx_add_spi_imx(
 		const struct spi_imx_master *pdata)
 {
 	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + data->iosize - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
+		DEFINE_RES_MEM(data->iobase, data->iosize),
+		DEFINE_RES_IRQ(data->irq),
 	};
 
 	return imx_add_platform_device(data->devid, data->id,
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* Re: [PATCH] new helper to define common struct resource constructs
  2011-07-11 14:40                 ` Uwe Kleine-König
  (?)
@ 2011-07-12 13:29                   ` Arnd Bergmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-12 13:29 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Sascha Hauer, Wolfram Sang, thierry.nolf.barco, Huang Shijie,
	linux-mtd, linux-arm-kernel, Lothar Waßmann, Andrew Morton,
	linux-kernel

On Monday 11 July 2011, Uwe Kleine-König wrote:
> resource definitions that just define start, end and flags = IORESOURCE_MEM
> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> for them. Also make available a macro to specify named resources of both
> types which are less common.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Arnd Bergmann <arnd@arndb.de>

What do others think, is this worthwhile?
Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH] new helper to define common struct resource constructs
@ 2011-07-12 13:29                   ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-12 13:29 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Sascha Hauer, Wolfram Sang, linux-kernel, thierry.nolf.barco,
	Huang Shijie, linux-mtd, Andrew Morton, linux-arm-kernel,
	Lothar Waßmann

On Monday 11 July 2011, Uwe Kleine-König wrote:
> resource definitions that just define start, end and flags = IORESOURCE_MEM
> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> for them. Also make available a macro to specify named resources of both
> types which are less common.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Arnd Bergmann <arnd@arndb.de>

What do others think, is this worthwhile?
Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH] new helper to define common struct resource constructs
@ 2011-07-12 13:29                   ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-12 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 11 July 2011, Uwe Kleine-K?nig wrote:
> resource definitions that just define start, end and flags = IORESOURCE_MEM
> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> for them. Also make available a macro to specify named resources of both
> types which are less common.
> 
> Signed-off-by: Uwe Kleine-K??nig <u.kleine-koenig@pengutronix.de>

Acked-by: Arnd Bergmann <arnd@arndb.de>

What do others think, is this worthwhile?
Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* RE: [PATCH] new helper to define common struct resource constructs
  2011-07-12 13:29                   ` Arnd Bergmann
@ 2011-07-12 17:13                     ` H Hartley Sweeten
  -1 siblings, 0 replies; 47+ messages in thread
From: H Hartley Sweeten @ 2011-07-12 17:13 UTC (permalink / raw)
  To: Arnd Bergmann, Uwe Kleine-König
  Cc: Sascha Hauer, Wolfram Sang, linux-kernel, thierry.nolf.barco,
	Huang Shijie, linux-mtd, Andrew Morton, linux-arm-kernel,
	Lothar Waßmann

On Tuesday, July 12, 2011 6:29 AM, Arnd Bergmann wrote:
> On Monday 11 July 2011, Uwe Kleine-König wrote:
>> resource definitions that just define start, end and flags = IORESOURCE_MEM
>> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
>> for them. Also make available a macro to specify named resources of both
>> types which are less common.
>> 
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> What do others think, is this worthwhile?

Assuming I found the correct patch in the archives, +1 from me.  Not sure what
the correct sign-off should be, possibly:

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>

> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?

As a gross check, on linux-next I see:

$ git grep IORESOURCE_MEM | wc -l
3989
$ git grep IORESOURCE_IRQ | wc -l
2309
$ git grep IORESOURCE_IO | wc -l
687
$ git grep IORESOURCE_DMA | wc -l
521

The *_MEM and *_IRQ macros are going to have the largest impact on reducing
the lines of code.  But, for completeness it might be nice to have the *_IO
and *_DMA ones also.

If this patch is accepted there are a couple private macros in various places
that should probably be replaced or updated.

For instance in mach-nomadik/board-nhk8815.c and mach-nomadik/cpu-8815.c there
are these:

#define __MEM_4K_RESOURCE(x) \
	.res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}

And plat-omap/i2c.c has this:

#define I2C_RESOURCE_BUILDER(base, irq)			\
	{						\
		.start	= (base),			\
		.end	= (base) + OMAP_I2C_SIZE,	\
		.flags	= IORESOURCE_MEM,		\
	},						\
	{						\
		.start	= (irq),			\
		.flags	= IORESOURCE_IRQ,		\
	},

I seem to recall seeing others but can't remember exactly where.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH] new helper to define common struct resource constructs
@ 2011-07-12 17:13                     ` H Hartley Sweeten
  0 siblings, 0 replies; 47+ messages in thread
From: H Hartley Sweeten @ 2011-07-12 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, July 12, 2011 6:29 AM, Arnd Bergmann wrote:
> On Monday 11 July 2011, Uwe Kleine-K?nig wrote:
>> resource definitions that just define start, end and flags = IORESOURCE_MEM
>> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
>> for them. Also make available a macro to specify named resources of both
>> types which are less common.
>> 
>> Signed-off-by: Uwe Kleine-K??nig <u.kleine-koenig@pengutronix.de>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> What do others think, is this worthwhile?

Assuming I found the correct patch in the archives, +1 from me.  Not sure what
the correct sign-off should be, possibly:

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>

> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?

As a gross check, on linux-next I see:

$ git grep IORESOURCE_MEM | wc -l
3989
$ git grep IORESOURCE_IRQ | wc -l
2309
$ git grep IORESOURCE_IO | wc -l
687
$ git grep IORESOURCE_DMA | wc -l
521

The *_MEM and *_IRQ macros are going to have the largest impact on reducing
the lines of code.  But, for completeness it might be nice to have the *_IO
and *_DMA ones also.

If this patch is accepted there are a couple private macros in various places
that should probably be replaced or updated.

For instance in mach-nomadik/board-nhk8815.c and mach-nomadik/cpu-8815.c there
are these:

#define __MEM_4K_RESOURCE(x) \
	.res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}

And plat-omap/i2c.c has this:

#define I2C_RESOURCE_BUILDER(base, irq)			\
	{						\
		.start	= (base),			\
		.end	= (base) + OMAP_I2C_SIZE,	\
		.flags	= IORESOURCE_MEM,		\
	},						\
	{						\
		.start	= (irq),			\
		.flags	= IORESOURCE_IRQ,		\
	},

I seem to recall seeing others but can't remember exactly where.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH v2] new helper to define common struct resource constructs
  2011-07-12 17:13                     ` H Hartley Sweeten
  (?)
@ 2011-07-12 18:31                       ` Uwe Kleine-König
  -1 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-12 18:31 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Arnd Bergmann, H Hartley Sweeten, Sascha Hauer, Wolfram Sang,
	linux-kernel, thierry.nolf.barco, Huang Shijie, linux-mtd,
	Andrew Morton, Lothar Waßmann

resource definitions that just define start, end and flags =
IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
introduce a shortcut for them. For completeness add macros for
IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
macros to specify named resources of all types.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
changes since v1:
- also add _IO and _DMA variants

 include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..f98124f 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = _start,					\
+		.end = _start + _size - 1,				\
+		.name = _name,						\
+		.flags = _flags,					\
+	}
+
+#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_IO)
+#define DEFINE_RES_IO(_start, _size)					\
+	DEFINE_RES_IO_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED(_irq, 1, _name, IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED(_irq, NULL)
+
+#define DEFINE_RES_DMA_NAMED(_dma, _name)				\
+	DEFINE_RES_NAMED(_dma, 1, _name, IORESOURCE_DMA)
+#define DEFINE_RES_DMA(_dma)						\
+	DEFINE_RES_DMA_NAMED(_dma, NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2] new helper to define common struct resource constructs
@ 2011-07-12 18:31                       ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-12 18:31 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Arnd Bergmann, Sascha Hauer, linux-kernel, Wolfram Sang,
	thierry.nolf.barco, Huang Shijie, linux-mtd, H Hartley Sweeten,
	Andrew Morton, Lothar Waßmann

resource definitions that just define start, end and flags =
IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
introduce a shortcut for them. For completeness add macros for
IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
macros to specify named resources of all types.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
changes since v1:
- also add _IO and _DMA variants

 include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..f98124f 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = _start,					\
+		.end = _start + _size - 1,				\
+		.name = _name,						\
+		.flags = _flags,					\
+	}
+
+#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_IO)
+#define DEFINE_RES_IO(_start, _size)					\
+	DEFINE_RES_IO_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED(_irq, 1, _name, IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED(_irq, NULL)
+
+#define DEFINE_RES_DMA_NAMED(_dma, _name)				\
+	DEFINE_RES_NAMED(_dma, 1, _name, IORESOURCE_DMA)
+#define DEFINE_RES_DMA(_dma)						\
+	DEFINE_RES_DMA_NAMED(_dma, NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v2] new helper to define common struct resource constructs
@ 2011-07-12 18:31                       ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-12 18:31 UTC (permalink / raw)
  To: linux-arm-kernel

resource definitions that just define start, end and flags =
IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
introduce a shortcut for them. For completeness add macros for
IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
macros to specify named resources of all types.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
changes since v1:
- also add _IO and _DMA variants

 include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..f98124f 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = _start,					\
+		.end = _start + _size - 1,				\
+		.name = _name,						\
+		.flags = _flags,					\
+	}
+
+#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_IO)
+#define DEFINE_RES_IO(_start, _size)					\
+	DEFINE_RES_IO_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED(_start, _size, _name, IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED(_start, _size, NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED(_irq, 1, _name, IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED(_irq, NULL)
+
+#define DEFINE_RES_DMA_NAMED(_dma, _name)				\
+	DEFINE_RES_NAMED(_dma, 1, _name, IORESOURCE_DMA)
+#define DEFINE_RES_DMA(_dma)						\
+	DEFINE_RES_DMA_NAMED(_dma, NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* Re: [PATCH] new helper to define common struct resource constructs
  2011-07-12 13:29                   ` Arnd Bergmann
  (?)
@ 2011-07-13 21:18                     ` Andrew Morton
  -1 siblings, 0 replies; 47+ messages in thread
From: Andrew Morton @ 2011-07-13 21:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc:  Uwe Kleine-König ,
	Sascha Hauer, Wolfram Sang, thierry.nolf.barco, Huang Shijie,
	linux-mtd, linux-arm-kernel, Lothar Waßmann, linux-kernel

On Tue, 12 Jul 2011 15:29:17 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
> > resource definitions that just define start, end and flags = IORESOURCE_MEM
> > or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> > for them. Also make available a macro to specify named resources of both
> > types which are less common.
> > 
> > Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> What do others think, is this worthwhile?
> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
> 

It would help if we could see some usage examples (ie: sample
conversions), to get a better idea of the value of this.

Also, DEFINE_RES_NAMED() is going to need a bunch of argument
parentheses to make it bulletproof.


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH] new helper to define common struct resource constructs
@ 2011-07-13 21:18                     ` Andrew Morton
  0 siblings, 0 replies; 47+ messages in thread
From: Andrew Morton @ 2011-07-13 21:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sascha Hauer, Wolfram Sang, linux-kernel, thierry.nolf.barco,
	Huang Shijie, linux-mtd,  Uwe Kleine-König ,
	linux-arm-kernel, Lothar Waßmann

On Tue, 12 Jul 2011 15:29:17 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
> > resource definitions that just define start, end and flags = IORESOURCE_MEM
> > or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> > for them. Also make available a macro to specify named resources of both
> > types which are less common.
> > 
> > Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> What do others think, is this worthwhile?
> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
> 

It would help if we could see some usage examples (ie: sample
conversions), to get a better idea of the value of this.

Also, DEFINE_RES_NAMED() is going to need a bunch of argument
parentheses to make it bulletproof.

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH] new helper to define common struct resource constructs
@ 2011-07-13 21:18                     ` Andrew Morton
  0 siblings, 0 replies; 47+ messages in thread
From: Andrew Morton @ 2011-07-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 12 Jul 2011 15:29:17 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
> > resource definitions that just define start, end and flags = IORESOURCE_MEM
> > or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> > for them. Also make available a macro to specify named resources of both
> > types which are less common.
> > 
> > Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> What do others think, is this worthwhile?
> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
> 

It would help if we could see some usage examples (ie: sample
conversions), to get a better idea of the value of this.

Also, DEFINE_RES_NAMED() is going to need a bunch of argument
parentheses to make it bulletproof.

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH] new helper to define common struct resource constructs
  2011-07-13 21:18                     ` Andrew Morton
  (?)
@ 2011-07-13 21:42                       ` Arnd Bergmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-13 21:42 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrew Morton, Sascha Hauer, Wolfram Sang, linux-kernel,
	thierry.nolf.barco, Huang Shijie, linux-mtd,
	 Uwe Kleine-König ,
	Lothar Waßmann

On Wednesday 13 July 2011 23:18:49 Andrew Morton wrote:
> > On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
> > > resource definitions that just define start, end and flags = IORESOURCE_MEM
> > > or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> > > for them. Also make available a macro to specify named resources of both
> > > types which are less common.
> > > 
> > > Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
> > 
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > 
> > What do others think, is this worthwhile?
> > Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
> > 
> 
> It would help if we could see some usage examples (ie: sample
> conversions), to get a better idea of the value of this.

Uwe posted a patch '[PATCH] ARM: mxc: use new helpers to define
common struct resource entries' that converts one ARM platform to use
it, with reasonable outcome:

26 files changed, 72 insertions(+), 308 deletions(-)

This platform has 72 definitions of static resources, in total there
are well over 2000 such defintions in ARM alone, and the number is
growing. Some platforms have started creating their own macros for
this purpose, which is why I suggested doing it globally (or alternatively
removing the macros from these platforms if we conclude that they
are harmful).

> Also, DEFINE_RES_NAMED() is going to need a bunch of argument
> parentheses to make it bulletproof.

Right.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH] new helper to define common struct resource constructs
@ 2011-07-13 21:42                       ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-13 21:42 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sascha Hauer, linux-kernel, Wolfram Sang, thierry.nolf.barco,
	Huang Shijie, linux-mtd, Uwe Kleine-König, Andrew Morton,
	Lothar Waßmann

On Wednesday 13 July 2011 23:18:49 Andrew Morton wrote:
> > On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
> > > resource definitions that just define start, end and flags = IORESOURCE_MEM
> > > or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> > > for them. Also make available a macro to specify named resources of both
> > > types which are less common.
> > > 
> > > Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
> > 
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > 
> > What do others think, is this worthwhile?
> > Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
> > 
> 
> It would help if we could see some usage examples (ie: sample
> conversions), to get a better idea of the value of this.

Uwe posted a patch '[PATCH] ARM: mxc: use new helpers to define
common struct resource entries' that converts one ARM platform to use
it, with reasonable outcome:

26 files changed, 72 insertions(+), 308 deletions(-)

This platform has 72 definitions of static resources, in total there
are well over 2000 such defintions in ARM alone, and the number is
growing. Some platforms have started creating their own macros for
this purpose, which is why I suggested doing it globally (or alternatively
removing the macros from these platforms if we conclude that they
are harmful).

> Also, DEFINE_RES_NAMED() is going to need a bunch of argument
> parentheses to make it bulletproof.

Right.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH] new helper to define common struct resource constructs
@ 2011-07-13 21:42                       ` Arnd Bergmann
  0 siblings, 0 replies; 47+ messages in thread
From: Arnd Bergmann @ 2011-07-13 21:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 13 July 2011 23:18:49 Andrew Morton wrote:
> > On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
> > > resource definitions that just define start, end and flags = IORESOURCE_MEM
> > > or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
> > > for them. Also make available a macro to specify named resources of both
> > > types which are less common.
> > > 
> > > Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
> > 
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > 
> > What do others think, is this worthwhile?
> > Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
> > 
> 
> It would help if we could see some usage examples (ie: sample
> conversions), to get a better idea of the value of this.

Uwe posted a patch '[PATCH] ARM: mxc: use new helpers to define
common struct resource entries' that converts one ARM platform to use
it, with reasonable outcome:

26 files changed, 72 insertions(+), 308 deletions(-)

This platform has 72 definitions of static resources, in total there
are well over 2000 such defintions in ARM alone, and the number is
growing. Some platforms have started creating their own macros for
this purpose, which is why I suggested doing it globally (or alternatively
removing the macros from these platforms if we conclude that they
are harmful).

> Also, DEFINE_RES_NAMED() is going to need a bunch of argument
> parentheses to make it bulletproof.

Right.

	Arnd

^ permalink raw reply	[flat|nested] 47+ messages in thread

* RE: [PATCH] new helper to define common struct resource constructs
  2011-07-13 21:42                       ` Arnd Bergmann
  (?)
@ 2011-07-13 22:15                         ` H Hartley Sweeten
  -1 siblings, 0 replies; 47+ messages in thread
From: H Hartley Sweeten @ 2011-07-13 22:15 UTC (permalink / raw)
  To: Arnd Bergmann, linux-arm-kernel
  Cc: Sascha Hauer, linux-kernel, Wolfram Sang, thierry.nolf.barco,
	Huang Shijie, linux-mtd, Uwe Kleine-König, Andrew Morton,
	Lothar Waßmann

On Wednesday, July 13, 2011 2:42 PM, Arnd Bergmann wrote:
> On Wednesday 13 July 2011 23:18:49 Andrew Morton wrote:
>>> On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
>>>> resource definitions that just define start, end and flags = IORESOURCE_MEM
>>>> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
>>>> for them. Also make available a macro to specify named resources of both
>>>> types which are less common.
>>>> 
>>>> Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
>>> 
>>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>> 
>>> What do others think, is this worthwhile?
>>> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
>>> 
>>
>> It would help if we could see some usage examples (ie: sample
>> conversions), to get a better idea of the value of this.
>
> Uwe posted a patch '[PATCH] ARM: mxc: use new helpers to define
> common struct resource entries' that converts one ARM platform to use
> it, with reasonable outcome:
>
> 26 files changed, 72 insertions(+), 308 deletions(-)

ep93xx doesn't have that many but converting it's core.c gives:

 1 files changed, 19 insertions(+), 93 deletions(-)

Regards,
Hartley

^ permalink raw reply	[flat|nested] 47+ messages in thread

* RE: [PATCH] new helper to define common struct resource constructs
@ 2011-07-13 22:15                         ` H Hartley Sweeten
  0 siblings, 0 replies; 47+ messages in thread
From: H Hartley Sweeten @ 2011-07-13 22:15 UTC (permalink / raw)
  To: Arnd Bergmann, linux-arm-kernel
  Cc: Sascha Hauer, linux-kernel, Wolfram Sang, thierry.nolf.barco,
	Huang Shijie, linux-mtd, Uwe Kleine-König, Andrew Morton,
	Lothar Waßmann

On Wednesday, July 13, 2011 2:42 PM, Arnd Bergmann wrote:
> On Wednesday 13 July 2011 23:18:49 Andrew Morton wrote:
>>> On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
>>>> resource definitions that just define start, end and flags = IORESOURCE_MEM
>>>> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
>>>> for them. Also make available a macro to specify named resources of both
>>>> types which are less common.
>>>> 
>>>> Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
>>> 
>>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>> 
>>> What do others think, is this worthwhile?
>>> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
>>> 
>>
>> It would help if we could see some usage examples (ie: sample
>> conversions), to get a better idea of the value of this.
>
> Uwe posted a patch '[PATCH] ARM: mxc: use new helpers to define
> common struct resource entries' that converts one ARM platform to use
> it, with reasonable outcome:
>
> 26 files changed, 72 insertions(+), 308 deletions(-)

ep93xx doesn't have that many but converting it's core.c gives:

 1 files changed, 19 insertions(+), 93 deletions(-)

Regards,
Hartley

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH] new helper to define common struct resource constructs
@ 2011-07-13 22:15                         ` H Hartley Sweeten
  0 siblings, 0 replies; 47+ messages in thread
From: H Hartley Sweeten @ 2011-07-13 22:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, July 13, 2011 2:42 PM, Arnd Bergmann wrote:
> On Wednesday 13 July 2011 23:18:49 Andrew Morton wrote:
>>> On Monday 11 July 2011, Uwe Kleine-K__nig wrote:
>>>> resource definitions that just define start, end and flags = IORESOURCE_MEM
>>>> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
>>>> for them. Also make available a macro to specify named resources of both
>>>> types which are less common.
>>>> 
>>>> Signed-off-by: Uwe Kleine-K____nig <u.kleine-koenig@pengutronix.de>
>>> 
>>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>> 
>>> What do others think, is this worthwhile?
>>> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
>>> 
>>
>> It would help if we could see some usage examples (ie: sample
>> conversions), to get a better idea of the value of this.
>
> Uwe posted a patch '[PATCH] ARM: mxc: use new helpers to define
> common struct resource entries' that converts one ARM platform to use
> it, with reasonable outcome:
>
> 26 files changed, 72 insertions(+), 308 deletions(-)

ep93xx doesn't have that many but converting it's core.c gives:

 1 files changed, 19 insertions(+), 93 deletions(-)

Regards,
Hartley

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH v3] new helper to define common struct resource constructs
  2011-07-13 21:18                     ` Andrew Morton
  (?)
@ 2011-07-14  8:11                       ` Uwe Kleine-König
  -1 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-14  8:11 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Arnd Bergmann, H Hartley Sweeten, Sascha Hauer, Wolfram Sang,
	linux-kernel, thierry.nolf.barco, Huang Shijie, linux-mtd,
	Andrew Morton, Lothar Waßmann

resource definitions that just define start, end and flags =
IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
introduce a shortcut for them. For completeness add macros for
IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
macros to specify named resources of all types which are less common.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
changes since v2:
- add parentheses around macro parameter usages

changes since v1:                                                               
- also add _IO and _DMA variants                                                

 include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..9d57a71 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = (_start),					\
+		.end = (_start) + (_size) - 1,				\
+		.name = (_name),					\
+		.flags = (_flags),					\
+	}
+
+#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
+#define DEFINE_RES_IO(_start, _size)					\
+	DEFINE_RES_IO_NAMED((_start), (_size), NULL)
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED((_start), (_size), NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED((_irq), NULL)
+
+#define DEFINE_RES_DMA_NAMED(_dma, _name)				\
+	DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA)
+#define DEFINE_RES_DMA(_dma)						\
+	DEFINE_RES_DMA_NAMED((_dma), NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v3] new helper to define common struct resource constructs
@ 2011-07-14  8:11                       ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-14  8:11 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Arnd Bergmann, Sascha Hauer, linux-kernel, Wolfram Sang,
	thierry.nolf.barco, Huang Shijie, linux-mtd, H Hartley Sweeten,
	Andrew Morton, Lothar Waßmann

resource definitions that just define start, end and flags =
IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
introduce a shortcut for them. For completeness add macros for
IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
macros to specify named resources of all types which are less common.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
changes since v2:
- add parentheses around macro parameter usages

changes since v1:                                                               
- also add _IO and _DMA variants                                                

 include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..9d57a71 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = (_start),					\
+		.end = (_start) + (_size) - 1,				\
+		.name = (_name),					\
+		.flags = (_flags),					\
+	}
+
+#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
+#define DEFINE_RES_IO(_start, _size)					\
+	DEFINE_RES_IO_NAMED((_start), (_size), NULL)
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED((_start), (_size), NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED((_irq), NULL)
+
+#define DEFINE_RES_DMA_NAMED(_dma, _name)				\
+	DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA)
+#define DEFINE_RES_DMA(_dma)						\
+	DEFINE_RES_DMA_NAMED((_dma), NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v3] new helper to define common struct resource constructs
@ 2011-07-14  8:11                       ` Uwe Kleine-König
  0 siblings, 0 replies; 47+ messages in thread
From: Uwe Kleine-König @ 2011-07-14  8:11 UTC (permalink / raw)
  To: linux-arm-kernel

resource definitions that just define start, end and flags =
IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
introduce a shortcut for them. For completeness add macros for
IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
macros to specify named resources of all types which are less common.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
changes since v2:
- add parentheses around macro parameter usages

changes since v1:                                                               
- also add _IO and _DMA variants                                                

 include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 63eb429..9d57a71 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+
+/* helpers to define resources */
+#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
+	{								\
+		.start = (_start),					\
+		.end = (_start) + (_size) - 1,				\
+		.name = (_name),					\
+		.flags = (_flags),					\
+	}
+
+#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
+#define DEFINE_RES_IO(_start, _size)					\
+	DEFINE_RES_IO_NAMED((_start), (_size), NULL)
+
+#define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
+	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM)
+#define DEFINE_RES_MEM(_start, _size)					\
+	DEFINE_RES_MEM_NAMED((_start), (_size), NULL)
+
+#define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
+	DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ)
+#define DEFINE_RES_IRQ(_irq)						\
+	DEFINE_RES_IRQ_NAMED((_irq), NULL)
+
+#define DEFINE_RES_DMA_NAMED(_dma, _name)				\
+	DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA)
+#define DEFINE_RES_DMA(_dma)						\
+	DEFINE_RES_DMA_NAMED((_dma), NULL)
+
 /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* Re: [PATCH v3] new helper to define common struct resource constructs
  2011-07-14  8:11                       ` Uwe Kleine-König
  (?)
@ 2011-07-14 11:34                         ` Lothar Waßmann
  -1 siblings, 0 replies; 47+ messages in thread
From: Lothar Waßmann @ 2011-07-14 11:34 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Arnd Bergmann, H Hartley Sweeten, Sascha Hauer,
	Wolfram Sang, linux-kernel, thierry.nolf.barco, Huang Shijie,
	linux-mtd, Andrew Morton

Hi,

Uwe Kleine-König writes:
> resource definitions that just define start, end and flags =
> IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
> introduce a shortcut for them. For completeness add macros for
> IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
> macros to specify named resources of all types which are less common.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> changes since v2:
> - add parentheses around macro parameter usages
> 
> changes since v1:                                                               
> - also add _IO and _DMA variants                                                
> 
>  include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> index 63eb429..9d57a71 100644
> --- a/include/linux/ioport.h
> +++ b/include/linux/ioport.h
> @@ -109,6 +109,36 @@ struct resource_list {
>  /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
>  #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
>  
> +
> +/* helpers to define resources */
> +#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
> +	{								\
> +		.start = (_start),					\
> +		.end = (_start) + (_size) - 1,				\
> +		.name = (_name),					\
> +		.flags = (_flags),					\
> +	}
> +
> +#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
> +	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
>
There is no need for parens around a macro argument when it is not
part of an expression...
This just looks silly.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v3] new helper to define common struct resource constructs
@ 2011-07-14 11:34                         ` Lothar Waßmann
  0 siblings, 0 replies; 47+ messages in thread
From: Lothar Waßmann @ 2011-07-14 11:34 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Arnd Bergmann, Sascha Hauer, linux-kernel, Wolfram Sang,
	thierry.nolf.barco, Huang Shijie, linux-mtd, H Hartley Sweeten,
	Andrew Morton, linux-arm-kernel

Hi,

Uwe Kleine-König writes:
> resource definitions that just define start, end and flags =
> IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
> introduce a shortcut for them. For completeness add macros for
> IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
> macros to specify named resources of all types which are less common.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> changes since v2:
> - add parentheses around macro parameter usages
> 
> changes since v1:                                                               
> - also add _IO and _DMA variants                                                
> 
>  include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> index 63eb429..9d57a71 100644
> --- a/include/linux/ioport.h
> +++ b/include/linux/ioport.h
> @@ -109,6 +109,36 @@ struct resource_list {
>  /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
>  #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
>  
> +
> +/* helpers to define resources */
> +#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
> +	{								\
> +		.start = (_start),					\
> +		.end = (_start) + (_size) - 1,				\
> +		.name = (_name),					\
> +		.flags = (_flags),					\
> +	}
> +
> +#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
> +	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
>
There is no need for parens around a macro argument when it is not
part of an expression...
This just looks silly.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH v3] new helper to define common struct resource constructs
@ 2011-07-14 11:34                         ` Lothar Waßmann
  0 siblings, 0 replies; 47+ messages in thread
From: Lothar Waßmann @ 2011-07-14 11:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Uwe Kleine-K?nig writes:
> resource definitions that just define start, end and flags =
> IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
> introduce a shortcut for them. For completeness add macros for
> IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
> macros to specify named resources of all types which are less common.
> 
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> ---
> changes since v2:
> - add parentheses around macro parameter usages
> 
> changes since v1:                                                               
> - also add _IO and _DMA variants                                                
> 
>  include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> index 63eb429..9d57a71 100644
> --- a/include/linux/ioport.h
> +++ b/include/linux/ioport.h
> @@ -109,6 +109,36 @@ struct resource_list {
>  /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
>  #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
>  
> +
> +/* helpers to define resources */
> +#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
> +	{								\
> +		.start = (_start),					\
> +		.end = (_start) + (_size) - 1,				\
> +		.name = (_name),					\
> +		.flags = (_flags),					\
> +	}
> +
> +#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
> +	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
>
There is no need for parens around a macro argument when it is not
part of an expression...
This just looks silly.


Lothar Wa?mann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2011-07-14 11:35 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 16:12 reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28 Huang Shijie-B32955
2011-06-30 16:12 ` Huang Shijie-B32955
2011-06-30 22:29 ` Arnd Bergmann
2011-06-30 22:29   ` Arnd Bergmann
2011-07-01  6:44   ` Uwe Kleine-König
2011-07-01  6:44     ` Uwe Kleine-König
2011-07-01  8:57   ` Huang Shijie
2011-07-01  8:57     ` Huang Shijie
2011-07-01  9:09     ` Arnd Bergmann
2011-07-01  9:09       ` Arnd Bergmann
2011-07-07  8:56       ` Huang Shijie
2011-07-07  8:56         ` Huang Shijie
2011-07-07 15:57         ` Arnd Bergmann
2011-07-07 15:57           ` Arnd Bergmann
2011-07-07 20:48           ` reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for?imx23/imx28 Uwe Kleine-König
2011-07-07 20:48             ` Uwe Kleine-König
2011-07-07 21:04             ` Arnd Bergmann
2011-07-07 21:04               ` Arnd Bergmann
2011-07-11 14:40               ` [PATCH] new helper to define common struct resource constructs Uwe Kleine-König
2011-07-11 14:40                 ` Uwe Kleine-König
2011-07-11 15:03                 ` [PATCH] ARM: mxc: use new helpers to define common struct resource entries Uwe Kleine-König
2011-07-11 15:03                   ` Uwe Kleine-König
2011-07-12 13:29                 ` [PATCH] new helper to define common struct resource constructs Arnd Bergmann
2011-07-12 13:29                   ` Arnd Bergmann
2011-07-12 13:29                   ` Arnd Bergmann
2011-07-12 17:13                   ` H Hartley Sweeten
2011-07-12 17:13                     ` H Hartley Sweeten
2011-07-12 18:31                     ` [PATCH v2] " Uwe Kleine-König
2011-07-12 18:31                       ` Uwe Kleine-König
2011-07-12 18:31                       ` Uwe Kleine-König
2011-07-13 21:18                   ` [PATCH] " Andrew Morton
2011-07-13 21:18                     ` Andrew Morton
2011-07-13 21:18                     ` Andrew Morton
2011-07-13 21:42                     ` Arnd Bergmann
2011-07-13 21:42                       ` Arnd Bergmann
2011-07-13 21:42                       ` Arnd Bergmann
2011-07-13 22:15                       ` H Hartley Sweeten
2011-07-13 22:15                         ` H Hartley Sweeten
2011-07-13 22:15                         ` H Hartley Sweeten
2011-07-14  8:11                     ` [PATCH v3] " Uwe Kleine-König
2011-07-14  8:11                       ` Uwe Kleine-König
2011-07-14  8:11                       ` Uwe Kleine-König
2011-07-14 11:34                       ` Lothar Waßmann
2011-07-14 11:34                         ` Lothar Waßmann
2011-07-14 11:34                         ` Lothar Waßmann
2011-07-01 14:52     ` reply: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28 Arnd Bergmann
2011-07-01 14:52       ` Arnd Bergmann

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.