diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-24 07:09:41 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-28 02:28:46 -0500 |
commit | 0e8b462de06e0559fc7c5a73d1d913782397987d (patch) | |
tree | 3841be45ff10fe13406d2b2f825f68d731c057e0 /arch/arm/mach-mxs | |
parent | ef19660b0aac537928a13a4087908cc23fa4c002 (diff) |
ARM i.MX23/28: do not use complicated macros if not necessary
Get rid of ## preprocessor construct where it only makes the
code harder to read.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/gpio.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/arch/arm/mach-mxs/gpio.c b/arch/arm/mach-mxs/gpio.c index 36df2d751749..8bcb34042252 100644 --- a/arch/arm/mach-mxs/gpio.c +++ b/arch/arm/mach-mxs/gpio.c | |||
@@ -287,21 +287,23 @@ int __init mxs_gpio_init(struct mxs_gpio_port *port, int cnt) | |||
287 | return 0; | 287 | return 0; |
288 | } | 288 | } |
289 | 289 | ||
290 | #define DEFINE_MXS_GPIO_PORT(soc, _id) \ | 290 | #define MX23_GPIO_BASE MX23_IO_ADDRESS(MX23_PINCTRL_BASE_ADDR) |
291 | #define MX28_GPIO_BASE MX28_IO_ADDRESS(MX28_PINCTRL_BASE_ADDR) | ||
292 | |||
293 | #define DEFINE_MXS_GPIO_PORT(_base, _irq, _id) \ | ||
291 | { \ | 294 | { \ |
292 | .chip.label = "gpio-" #_id, \ | 295 | .chip.label = "gpio-" #_id, \ |
293 | .id = _id, \ | 296 | .id = _id, \ |
294 | .irq = soc ## _INT_GPIO ## _id, \ | 297 | .irq = _irq, \ |
295 | .base = soc ## _IO_ADDRESS( \ | 298 | .base = _base, \ |
296 | soc ## _PINCTRL ## _BASE_ADDR), \ | ||
297 | .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ | 299 | .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ |
298 | } | 300 | } |
299 | 301 | ||
300 | #ifdef CONFIG_SOC_IMX23 | 302 | #ifdef CONFIG_SOC_IMX23 |
301 | static struct mxs_gpio_port mx23_gpio_ports[] = { | 303 | static struct mxs_gpio_port mx23_gpio_ports[] = { |
302 | DEFINE_MXS_GPIO_PORT(MX23, 0), | 304 | DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO0, 0), |
303 | DEFINE_MXS_GPIO_PORT(MX23, 1), | 305 | DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO1, 1), |
304 | DEFINE_MXS_GPIO_PORT(MX23, 2), | 306 | DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO2, 2), |
305 | }; | 307 | }; |
306 | 308 | ||
307 | int __init mx23_register_gpios(void) | 309 | int __init mx23_register_gpios(void) |
@@ -312,11 +314,11 @@ int __init mx23_register_gpios(void) | |||
312 | 314 | ||
313 | #ifdef CONFIG_SOC_IMX28 | 315 | #ifdef CONFIG_SOC_IMX28 |
314 | static struct mxs_gpio_port mx28_gpio_ports[] = { | 316 | static struct mxs_gpio_port mx28_gpio_ports[] = { |
315 | DEFINE_MXS_GPIO_PORT(MX28, 0), | 317 | DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO0, 0), |
316 | DEFINE_MXS_GPIO_PORT(MX28, 1), | 318 | DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO1, 1), |
317 | DEFINE_MXS_GPIO_PORT(MX28, 2), | 319 | DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO2, 2), |
318 | DEFINE_MXS_GPIO_PORT(MX28, 3), | 320 | DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO3, 3), |
319 | DEFINE_MXS_GPIO_PORT(MX28, 4), | 321 | DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO4, 4), |
320 | }; | 322 | }; |
321 | 323 | ||
322 | int __init mx28_register_gpios(void) | 324 | int __init mx28_register_gpios(void) |