From fe158a17c1e0d477f08990f426f30e13eb3c8851 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 5 Sep 2016 16:18:45 +0200 Subject: ARM: orion: simplify orion_ge00_switch_init One of the last users of NO_IRQ on ARM is the switch initialization code on orion5x, which sometimes passes a GPIO based IRQ number. However, the driver doesn't actually use this number, and according to Andrew Lunn never will do it for non-DT based machines, so we can simply drop the irq argument. Simplifying it further, we can also drop the static platform_device and instead call platform_device_register_data(), which in turn lets us mark the platform_data structures as __initdata and slightly reduce the memory consumption. Signed-off-by: Arnd Bergmann Signed-off-by: Gregory CLEMENT --- arch/arm/plat-orion/common.c | 26 ++------------------------ arch/arm/plat-orion/include/plat/common.h | 3 +-- 2 files changed, 3 insertions(+), 26 deletions(-) (limited to 'arch/arm/plat-orion') diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 7b9b70785a54..272f49b2c68f 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c @@ -470,37 +470,15 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, /***************************************************************************** * Ethernet switch ****************************************************************************/ -static struct resource orion_switch_resources[] = { - { - .start = 0, - .end = 0, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device orion_switch_device = { - .name = "dsa", - .id = 0, - .num_resources = 0, - .resource = orion_switch_resources, -}; - -void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq) +void __init orion_ge00_switch_init(struct dsa_platform_data *d) { int i; - if (irq != NO_IRQ) { - orion_switch_resources[0].start = irq; - orion_switch_resources[0].end = irq; - orion_switch_device.num_resources = 1; - } - d->netdev = &orion_ge00.dev; for (i = 0; i < d->nr_chips; i++) d->chip[i].host_dev = &orion_ge_mvmdio.dev; - orion_switch_device.dev.platform_data = d; - platform_device_register(&orion_switch_device); + platform_device_register_data(NULL, "dsa", 0, d, sizeof(d)); } /***************************************************************************** diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h index 8519727faa5e..9347f3c58a6d 100644 --- a/arch/arm/plat-orion/include/plat/common.h +++ b/arch/arm/plat-orion/include/plat/common.h @@ -57,8 +57,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, unsigned long mapbase, unsigned long irq); -void __init orion_ge00_switch_init(struct dsa_platform_data *d, - int irq); +void __init orion_ge00_switch_init(struct dsa_platform_data *d); void __init orion_i2c_init(unsigned long mapbase, unsigned long irq, -- cgit v1.2.3