All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation
@ 2016-09-06 14:06 ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: Jason Cooper, Andrew Lunn, Gregory Clement, Sebastian Hesselbarth
  Cc: linux-arm-kernel, Russell King, linux-kernel, Arnd Bergmann

Out of the four ethernet devices on mv78xx0, only the first one
has an error interrupt line, for the other ones we pass NO_IRQ
and then ignore the argument.

In order to get closer to complete remove of NO_IRQ, this simply
drops the unused function arguments.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-mv78xx0/common.c            | 9 ++-------
 arch/arm/plat-orion/common.c              | 7 ++-----
 arch/arm/plat-orion/include/plat/common.h | 7 ++-----
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 6af5430d0d97..f72e1e9f5fc5 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -219,7 +219,6 @@ void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data)
 {
 	orion_ge01_init(eth_data,
 			GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM,
-			NO_IRQ,
 			MV643XX_TX_CSUM_DEFAULT_LIMIT);
 }
 
@@ -242,9 +241,7 @@ void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
 		eth_data->duplex = DUPLEX_FULL;
 	}
 
-	orion_ge10_init(eth_data,
-			GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM,
-			NO_IRQ);
+	orion_ge10_init(eth_data, GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM);
 }
 
 
@@ -266,9 +263,7 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
 		eth_data->duplex = DUPLEX_FULL;
 	}
 
-	orion_ge11_init(eth_data,
-			GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM,
-			NO_IRQ);
+	orion_ge11_init(eth_data, GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM);
 }
 
 /*****************************************************************************
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 78c8bf4043c0..7757f71fe709 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -354,7 +354,6 @@ static struct platform_device orion_ge01 = {
 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
 			    unsigned long irq,
-			    unsigned long irq_err,
 			    unsigned int tx_csum_limit)
 {
 	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
@@ -404,8 +403,7 @@ static struct platform_device orion_ge10 = {
 
 void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err)
+			    unsigned long irq)
 {
 	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
 		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
@@ -453,8 +451,7 @@ static struct platform_device orion_ge11 = {
 
 void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err)
+			    unsigned long irq)
 {
 	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
 		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h
index 9e6d76ad48a9..8519727faa5e 100644
--- a/arch/arm/plat-orion/include/plat/common.h
+++ b/arch/arm/plat-orion/include/plat/common.h
@@ -47,18 +47,15 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
 			    unsigned long irq,
-			    unsigned long irq_err,
 			    unsigned int tx_csum_limit);
 
 void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err);
+			    unsigned long irq);
 
 void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err);
+			    unsigned long irq);
 
 void __init orion_ge00_switch_init(struct dsa_platform_data *d,
 				   int irq);
-- 
2.9.0

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

* [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation
@ 2016-09-06 14:06 ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

Out of the four ethernet devices on mv78xx0, only the first one
has an error interrupt line, for the other ones we pass NO_IRQ
and then ignore the argument.

In order to get closer to complete remove of NO_IRQ, this simply
drops the unused function arguments.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-mv78xx0/common.c            | 9 ++-------
 arch/arm/plat-orion/common.c              | 7 ++-----
 arch/arm/plat-orion/include/plat/common.h | 7 ++-----
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 6af5430d0d97..f72e1e9f5fc5 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -219,7 +219,6 @@ void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data)
 {
 	orion_ge01_init(eth_data,
 			GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM,
-			NO_IRQ,
 			MV643XX_TX_CSUM_DEFAULT_LIMIT);
 }
 
@@ -242,9 +241,7 @@ void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
 		eth_data->duplex = DUPLEX_FULL;
 	}
 
-	orion_ge10_init(eth_data,
-			GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM,
-			NO_IRQ);
+	orion_ge10_init(eth_data, GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM);
 }
 
 
@@ -266,9 +263,7 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
 		eth_data->duplex = DUPLEX_FULL;
 	}
 
-	orion_ge11_init(eth_data,
-			GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM,
-			NO_IRQ);
+	orion_ge11_init(eth_data, GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM);
 }
 
 /*****************************************************************************
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 78c8bf4043c0..7757f71fe709 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -354,7 +354,6 @@ static struct platform_device orion_ge01 = {
 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
 			    unsigned long irq,
-			    unsigned long irq_err,
 			    unsigned int tx_csum_limit)
 {
 	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
@@ -404,8 +403,7 @@ static struct platform_device orion_ge10 = {
 
 void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err)
+			    unsigned long irq)
 {
 	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
 		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
@@ -453,8 +451,7 @@ static struct platform_device orion_ge11 = {
 
 void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err)
+			    unsigned long irq)
 {
 	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
 		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h
index 9e6d76ad48a9..8519727faa5e 100644
--- a/arch/arm/plat-orion/include/plat/common.h
+++ b/arch/arm/plat-orion/include/plat/common.h
@@ -47,18 +47,15 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
 			    unsigned long irq,
-			    unsigned long irq_err,
 			    unsigned int tx_csum_limit);
 
 void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err);
+			    unsigned long irq);
 
 void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long mapbase,
-			    unsigned long irq,
-			    unsigned long irq_err);
+			    unsigned long irq);
 
 void __init orion_ge00_switch_init(struct dsa_platform_data *d,
 				   int irq);
-- 
2.9.0

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

* [PATCH 2/4] ARM: mvebu/orion: remove NO_IRQ check from device init
  2016-09-06 14:06 ` Arnd Bergmann
@ 2016-09-06 14:06   ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: Jason Cooper, Andrew Lunn, Gregory Clement, Sebastian Hesselbarth
  Cc: linux-arm-kernel, Russell King, linux-kernel, Arnd Bergmann

For most devices, we know in advance whether they have an
interrupt line or not, so we can avoid passing NO_IRQ and
instead split fill_resources() into two interfaces, with
only the new fill_resources_irq() function taking an irq
argument, which it then can use unconditionally.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/plat-orion/common.c | 52 ++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 23 deletions(-)

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 7757f71fe709..7b9b70785a54 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -52,21 +52,27 @@ void __init orion_clkdev_init(struct clk *tclk)
 static void fill_resources(struct platform_device *device,
 			   struct resource *resources,
 			   resource_size_t mapbase,
-			   resource_size_t size,
-			   unsigned int irq)
+			   resource_size_t size)
 {
 	device->resource = resources;
 	device->num_resources = 1;
 	resources[0].flags = IORESOURCE_MEM;
 	resources[0].start = mapbase;
 	resources[0].end = mapbase + size;
+}
 
-	if (irq != NO_IRQ) {
-		device->num_resources++;
-		resources[1].flags = IORESOURCE_IRQ;
-		resources[1].start = irq;
-		resources[1].end = irq;
-	}
+static void fill_resources_irq(struct platform_device *device,
+			       struct resource *resources,
+			       resource_size_t mapbase,
+			       resource_size_t size,
+			       unsigned int irq)
+{
+	fill_resources(device, resources, mapbase, size);
+
+	device->num_resources++;
+	resources[1].flags = IORESOURCE_IRQ;
+	resources[1].start = irq;
+	resources[1].end = irq;
 }
 
 /*****************************************************************************
@@ -93,7 +99,7 @@ static void __init uart_complete(
 	data->uartclk = uart_get_clk_rate(clk);
 	orion_uart->dev.platform_data = data;
 
-	fill_resources(orion_uart, resources, mapbase, 0xff, irq);
+	fill_resources_irq(orion_uart, resources, mapbase, 0xff, irq);
 	platform_device_register(orion_uart);
 }
 
@@ -305,8 +311,8 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned int tx_csum_limit)
 {
 	fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
-	fill_resources(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
+		       mapbase + 0x2000, SZ_16K - 1);
+	fill_resources_irq(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
 			mapbase + 0x2004, 0x84 - 1, irq_err);
 	orion_ge00_shared_data.tx_csum_limit = tx_csum_limit;
 	ge_complete(&orion_ge00_shared_data,
@@ -357,7 +363,7 @@ void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned int tx_csum_limit)
 {
 	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
+		       mapbase + 0x2000, SZ_16K - 1);
 	orion_ge01_shared_data.tx_csum_limit = tx_csum_limit;
 	ge_complete(&orion_ge01_shared_data,
 		    orion_ge01_resources, irq, &orion_ge01_shared,
@@ -406,7 +412,7 @@ void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long irq)
 {
 	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
+		       mapbase + 0x2000, SZ_16K - 1);
 	ge_complete(&orion_ge10_shared_data,
 		    orion_ge10_resources, irq, &orion_ge10_shared,
 		    NULL,
@@ -454,7 +460,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long irq)
 {
 	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
+		       mapbase + 0x2000, SZ_16K - 1);
 	ge_complete(&orion_ge11_shared_data,
 		    orion_ge11_resources, irq, &orion_ge11_shared,
 		    NULL,
@@ -535,7 +541,7 @@ void __init orion_i2c_init(unsigned long mapbase,
 			   unsigned long freq_m)
 {
 	orion_i2c_pdata.freq_m = freq_m;
-	fill_resources(&orion_i2c, orion_i2c_resources, mapbase,
+	fill_resources_irq(&orion_i2c, orion_i2c_resources, mapbase,
 		       SZ_32 - 1, irq);
 	platform_device_register(&orion_i2c);
 }
@@ -545,7 +551,7 @@ void __init orion_i2c_1_init(unsigned long mapbase,
 			     unsigned long freq_m)
 {
 	orion_i2c_1_pdata.freq_m = freq_m;
-	fill_resources(&orion_i2c_1, orion_i2c_1_resources, mapbase,
+	fill_resources_irq(&orion_i2c_1, orion_i2c_1_resources, mapbase,
 		       SZ_32 - 1, irq);
 	platform_device_register(&orion_i2c_1);
 }
@@ -573,14 +579,14 @@ static struct platform_device orion_spi_1 = {
 void __init orion_spi_init(unsigned long mapbase)
 {
 	fill_resources(&orion_spi, &orion_spi_resources,
-		       mapbase, SZ_512 - 1, NO_IRQ);
+		       mapbase, SZ_512 - 1);
 	platform_device_register(&orion_spi);
 }
 
 void __init orion_spi_1_init(unsigned long mapbase)
 {
 	fill_resources(&orion_spi_1, &orion_spi_1_resources,
-		       mapbase, SZ_512 - 1, NO_IRQ);
+		       mapbase, SZ_512 - 1);
 	platform_device_register(&orion_spi_1);
 }
 
@@ -738,7 +744,7 @@ void __init orion_ehci_init(unsigned long mapbase,
 			    enum orion_ehci_phy_ver phy_version)
 {
 	orion_ehci_data.phy_version = phy_version;
-	fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
+	fill_resources_irq(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
 		       irq);
 
 	platform_device_register(&orion_ehci);
@@ -762,7 +768,7 @@ static struct platform_device orion_ehci_1 = {
 void __init orion_ehci_1_init(unsigned long mapbase,
 			      unsigned long irq)
 {
-	fill_resources(&orion_ehci_1, orion_ehci_1_resources,
+	fill_resources_irq(&orion_ehci_1, orion_ehci_1_resources,
 		       mapbase, SZ_4K - 1, irq);
 
 	platform_device_register(&orion_ehci_1);
@@ -786,7 +792,7 @@ static struct platform_device orion_ehci_2 = {
 void __init orion_ehci_2_init(unsigned long mapbase,
 			      unsigned long irq)
 {
-	fill_resources(&orion_ehci_2, orion_ehci_2_resources,
+	fill_resources_irq(&orion_ehci_2, orion_ehci_2_resources,
 		       mapbase, SZ_4K - 1, irq);
 
 	platform_device_register(&orion_ehci_2);
@@ -816,7 +822,7 @@ void __init orion_sata_init(struct mv_sata_platform_data *sata_data,
 			    unsigned long irq)
 {
 	orion_sata.dev.platform_data = sata_data;
-	fill_resources(&orion_sata, orion_sata_resources,
+	fill_resources_irq(&orion_sata, orion_sata_resources,
 		       mapbase, 0x5000 - 1, irq);
 
 	platform_device_register(&orion_sata);
@@ -846,7 +852,7 @@ void __init orion_crypto_init(unsigned long mapbase,
 			      unsigned long sram_size,
 			      unsigned long irq)
 {
-	fill_resources(&orion_crypto, orion_crypto_resources,
+	fill_resources_irq(&orion_crypto, orion_crypto_resources,
 		       mapbase, 0xffff, irq);
 	orion_crypto.num_resources = 3;
 	orion_crypto_resources[2].start = srambase;
-- 
2.9.0

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

* [PATCH 2/4] ARM: mvebu/orion: remove NO_IRQ check from device init
@ 2016-09-06 14:06   ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

For most devices, we know in advance whether they have an
interrupt line or not, so we can avoid passing NO_IRQ and
instead split fill_resources() into two interfaces, with
only the new fill_resources_irq() function taking an irq
argument, which it then can use unconditionally.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/plat-orion/common.c | 52 ++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 23 deletions(-)

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 7757f71fe709..7b9b70785a54 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -52,21 +52,27 @@ void __init orion_clkdev_init(struct clk *tclk)
 static void fill_resources(struct platform_device *device,
 			   struct resource *resources,
 			   resource_size_t mapbase,
-			   resource_size_t size,
-			   unsigned int irq)
+			   resource_size_t size)
 {
 	device->resource = resources;
 	device->num_resources = 1;
 	resources[0].flags = IORESOURCE_MEM;
 	resources[0].start = mapbase;
 	resources[0].end = mapbase + size;
+}
 
-	if (irq != NO_IRQ) {
-		device->num_resources++;
-		resources[1].flags = IORESOURCE_IRQ;
-		resources[1].start = irq;
-		resources[1].end = irq;
-	}
+static void fill_resources_irq(struct platform_device *device,
+			       struct resource *resources,
+			       resource_size_t mapbase,
+			       resource_size_t size,
+			       unsigned int irq)
+{
+	fill_resources(device, resources, mapbase, size);
+
+	device->num_resources++;
+	resources[1].flags = IORESOURCE_IRQ;
+	resources[1].start = irq;
+	resources[1].end = irq;
 }
 
 /*****************************************************************************
@@ -93,7 +99,7 @@ static void __init uart_complete(
 	data->uartclk = uart_get_clk_rate(clk);
 	orion_uart->dev.platform_data = data;
 
-	fill_resources(orion_uart, resources, mapbase, 0xff, irq);
+	fill_resources_irq(orion_uart, resources, mapbase, 0xff, irq);
 	platform_device_register(orion_uart);
 }
 
@@ -305,8 +311,8 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned int tx_csum_limit)
 {
 	fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
-	fill_resources(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
+		       mapbase + 0x2000, SZ_16K - 1);
+	fill_resources_irq(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
 			mapbase + 0x2004, 0x84 - 1, irq_err);
 	orion_ge00_shared_data.tx_csum_limit = tx_csum_limit;
 	ge_complete(&orion_ge00_shared_data,
@@ -357,7 +363,7 @@ void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned int tx_csum_limit)
 {
 	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
+		       mapbase + 0x2000, SZ_16K - 1);
 	orion_ge01_shared_data.tx_csum_limit = tx_csum_limit;
 	ge_complete(&orion_ge01_shared_data,
 		    orion_ge01_resources, irq, &orion_ge01_shared,
@@ -406,7 +412,7 @@ void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long irq)
 {
 	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
+		       mapbase + 0x2000, SZ_16K - 1);
 	ge_complete(&orion_ge10_shared_data,
 		    orion_ge10_resources, irq, &orion_ge10_shared,
 		    NULL,
@@ -454,7 +460,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
 			    unsigned long irq)
 {
 	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
-		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
+		       mapbase + 0x2000, SZ_16K - 1);
 	ge_complete(&orion_ge11_shared_data,
 		    orion_ge11_resources, irq, &orion_ge11_shared,
 		    NULL,
@@ -535,7 +541,7 @@ void __init orion_i2c_init(unsigned long mapbase,
 			   unsigned long freq_m)
 {
 	orion_i2c_pdata.freq_m = freq_m;
-	fill_resources(&orion_i2c, orion_i2c_resources, mapbase,
+	fill_resources_irq(&orion_i2c, orion_i2c_resources, mapbase,
 		       SZ_32 - 1, irq);
 	platform_device_register(&orion_i2c);
 }
@@ -545,7 +551,7 @@ void __init orion_i2c_1_init(unsigned long mapbase,
 			     unsigned long freq_m)
 {
 	orion_i2c_1_pdata.freq_m = freq_m;
-	fill_resources(&orion_i2c_1, orion_i2c_1_resources, mapbase,
+	fill_resources_irq(&orion_i2c_1, orion_i2c_1_resources, mapbase,
 		       SZ_32 - 1, irq);
 	platform_device_register(&orion_i2c_1);
 }
@@ -573,14 +579,14 @@ static struct platform_device orion_spi_1 = {
 void __init orion_spi_init(unsigned long mapbase)
 {
 	fill_resources(&orion_spi, &orion_spi_resources,
-		       mapbase, SZ_512 - 1, NO_IRQ);
+		       mapbase, SZ_512 - 1);
 	platform_device_register(&orion_spi);
 }
 
 void __init orion_spi_1_init(unsigned long mapbase)
 {
 	fill_resources(&orion_spi_1, &orion_spi_1_resources,
-		       mapbase, SZ_512 - 1, NO_IRQ);
+		       mapbase, SZ_512 - 1);
 	platform_device_register(&orion_spi_1);
 }
 
@@ -738,7 +744,7 @@ void __init orion_ehci_init(unsigned long mapbase,
 			    enum orion_ehci_phy_ver phy_version)
 {
 	orion_ehci_data.phy_version = phy_version;
-	fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
+	fill_resources_irq(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
 		       irq);
 
 	platform_device_register(&orion_ehci);
@@ -762,7 +768,7 @@ static struct platform_device orion_ehci_1 = {
 void __init orion_ehci_1_init(unsigned long mapbase,
 			      unsigned long irq)
 {
-	fill_resources(&orion_ehci_1, orion_ehci_1_resources,
+	fill_resources_irq(&orion_ehci_1, orion_ehci_1_resources,
 		       mapbase, SZ_4K - 1, irq);
 
 	platform_device_register(&orion_ehci_1);
@@ -786,7 +792,7 @@ static struct platform_device orion_ehci_2 = {
 void __init orion_ehci_2_init(unsigned long mapbase,
 			      unsigned long irq)
 {
-	fill_resources(&orion_ehci_2, orion_ehci_2_resources,
+	fill_resources_irq(&orion_ehci_2, orion_ehci_2_resources,
 		       mapbase, SZ_4K - 1, irq);
 
 	platform_device_register(&orion_ehci_2);
@@ -816,7 +822,7 @@ void __init orion_sata_init(struct mv_sata_platform_data *sata_data,
 			    unsigned long irq)
 {
 	orion_sata.dev.platform_data = sata_data;
-	fill_resources(&orion_sata, orion_sata_resources,
+	fill_resources_irq(&orion_sata, orion_sata_resources,
 		       mapbase, 0x5000 - 1, irq);
 
 	platform_device_register(&orion_sata);
@@ -846,7 +852,7 @@ void __init orion_crypto_init(unsigned long mapbase,
 			      unsigned long sram_size,
 			      unsigned long irq)
 {
-	fill_resources(&orion_crypto, orion_crypto_resources,
+	fill_resources_irq(&orion_crypto, orion_crypto_resources,
 		       mapbase, 0xffff, irq);
 	orion_crypto.num_resources = 3;
 	orion_crypto_resources[2].start = srambase;
-- 
2.9.0

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

* [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
  2016-09-06 14:06 ` Arnd Bergmann
@ 2016-09-06 14:06   ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: Jason Cooper, Andrew Lunn, Gregory Clement, Sebastian Hesselbarth
  Cc: linux-arm-kernel, Russell King, linux-kernel, Arnd Bergmann

As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
normal convention of using '0' to indicate an invalid interrupt, rather
than the deprecated NO_IRQ constant

My first approach was to pass a pointer to the resource into
orion_ge00_switch_init(), but it seemed to just add complexity
for no good.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c | 2 +-
 arch/arm/mach-orion5x/wnr854t-setup.c        | 2 +-
 arch/arm/mach-orion5x/wrt350n-v2-setup.c     | 2 +-
 arch/arm/plat-orion/common.c                 | 7 +++----
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index c742e7b40b0d..8df5cb8263a2 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -120,7 +120,7 @@ static void __init rd88f5181l_fxo_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f5181l_fxo_eth_data);
-	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, 0);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 4e1e5c8f6111..5e929d5e5a23 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -124,7 +124,7 @@ static void __init wnr854t_init(void)
 	 * Configure peripherals.
 	 */
 	orion5x_eth_init(&wnr854t_eth_data);
-	orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wnr854t_switch_plat_data, 0);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 61e9027ef224..826ca94ef248 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -210,7 +210,7 @@ static void __init wrt350n_v2_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&wrt350n_v2_eth_data);
-	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, 0);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 7b9b70785a54..30328e92ca58 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -489,11 +489,10 @@ void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq)
 {
 	int i;
 
-	if (irq != NO_IRQ) {
-		orion_switch_resources[0].start = irq;
-		orion_switch_resources[0].end = irq;
+	orion_switch_resources[0].start = irq;
+	orion_switch_resources[0].end = irq;
+	if (irq)
 		orion_switch_device.num_resources = 1;
-	}
 
 	d->netdev = &orion_ge00.dev;
 	for (i = 0; i < d->nr_chips; i++)
-- 
2.9.0

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

* [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
@ 2016-09-06 14:06   ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
normal convention of using '0' to indicate an invalid interrupt, rather
than the deprecated NO_IRQ constant

My first approach was to pass a pointer to the resource into
orion_ge00_switch_init(), but it seemed to just add complexity
for no good.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c | 2 +-
 arch/arm/mach-orion5x/wnr854t-setup.c        | 2 +-
 arch/arm/mach-orion5x/wrt350n-v2-setup.c     | 2 +-
 arch/arm/plat-orion/common.c                 | 7 +++----
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index c742e7b40b0d..8df5cb8263a2 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -120,7 +120,7 @@ static void __init rd88f5181l_fxo_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f5181l_fxo_eth_data);
-	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, 0);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 4e1e5c8f6111..5e929d5e5a23 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -124,7 +124,7 @@ static void __init wnr854t_init(void)
 	 * Configure peripherals.
 	 */
 	orion5x_eth_init(&wnr854t_eth_data);
-	orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wnr854t_switch_plat_data, 0);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 61e9027ef224..826ca94ef248 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -210,7 +210,7 @@ static void __init wrt350n_v2_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&wrt350n_v2_eth_data);
-	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, 0);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 7b9b70785a54..30328e92ca58 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -489,11 +489,10 @@ void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq)
 {
 	int i;
 
-	if (irq != NO_IRQ) {
-		orion_switch_resources[0].start = irq;
-		orion_switch_resources[0].end = irq;
+	orion_switch_resources[0].start = irq;
+	orion_switch_resources[0].end = irq;
+	if (irq)
 		orion_switch_device.num_resources = 1;
-	}
 
 	d->netdev = &orion_ge00.dev;
 	for (i = 0; i < d->nr_chips; i++)
-- 
2.9.0

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

* [PATCH 4/4] ARM: orion5x: remove extraneous NO_IRQ
  2016-09-06 14:06 ` Arnd Bergmann
@ 2016-09-06 14:06   ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: Jason Cooper, Andrew Lunn, Gregory Clement, Sebastian Hesselbarth
  Cc: linux-arm-kernel, Russell King, linux-kernel, Arnd Bergmann

rd88f6183ap-ge passes NO_IRQ as the interrupt line for its m25p80
NOR flash. However, this device never uses an interrupt and the
driver doesn't care, so we can simply remove the deprecated constant
here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 4bf80dd5478c..8ffaead76771 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -71,7 +71,6 @@ static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
 	{
 		.modalias	= "m25p80",
 		.platform_data	= &rd88f6183ap_ge_spi_slave_data,
-		.irq		= NO_IRQ,
 		.max_speed_hz	= 20000000,
 		.bus_num	= 0,
 		.chip_select	= 0,
-- 
2.9.0

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

* [PATCH 4/4] ARM: orion5x: remove extraneous NO_IRQ
@ 2016-09-06 14:06   ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-06 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

rd88f6183ap-ge passes NO_IRQ as the interrupt line for its m25p80
NOR flash. However, this device never uses an interrupt and the
driver doesn't care, so we can simply remove the deprecated constant
here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 4bf80dd5478c..8ffaead76771 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -71,7 +71,6 @@ static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
 	{
 		.modalias	= "m25p80",
 		.platform_data	= &rd88f6183ap_ge_spi_slave_data,
-		.irq		= NO_IRQ,
 		.max_speed_hz	= 20000000,
 		.bus_num	= 0,
 		.chip_select	= 0,
-- 
2.9.0

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

* Re: [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation
  2016-09-06 14:06 ` Arnd Bergmann
@ 2016-09-07  1:30   ` Andrew Lunn
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrew Lunn @ 2016-09-07  1:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jason Cooper, Gregory Clement, Sebastian Hesselbarth,
	linux-arm-kernel, Russell King, linux-kernel

On Tue, Sep 06, 2016 at 04:06:20PM +0200, Arnd Bergmann wrote:
> Out of the four ethernet devices on mv78xx0, only the first one
> has an error interrupt line, for the other ones we pass NO_IRQ
> and then ignore the argument.
> 
> In order to get closer to complete remove of NO_IRQ, this simply
> drops the unused function arguments.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation
@ 2016-09-07  1:30   ` Andrew Lunn
  0 siblings, 0 replies; 24+ messages in thread
From: Andrew Lunn @ 2016-09-07  1:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 06, 2016 at 04:06:20PM +0200, Arnd Bergmann wrote:
> Out of the four ethernet devices on mv78xx0, only the first one
> has an error interrupt line, for the other ones we pass NO_IRQ
> and then ignore the argument.
> 
> In order to get closer to complete remove of NO_IRQ, this simply
> drops the unused function arguments.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH 4/4] ARM: orion5x: remove extraneous NO_IRQ
  2016-09-06 14:06   ` Arnd Bergmann
@ 2016-09-07  1:49     ` Andrew Lunn
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrew Lunn @ 2016-09-07  1:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jason Cooper, Gregory Clement, Sebastian Hesselbarth,
	linux-arm-kernel, Russell King, linux-kernel

On Tue, Sep 06, 2016 at 04:06:23PM +0200, Arnd Bergmann wrote:
> rd88f6183ap-ge passes NO_IRQ as the interrupt line for its m25p80
> NOR flash. However, this device never uses an interrupt and the
> driver doesn't care, so we can simply remove the deprecated constant
> here.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* [PATCH 4/4] ARM: orion5x: remove extraneous NO_IRQ
@ 2016-09-07  1:49     ` Andrew Lunn
  0 siblings, 0 replies; 24+ messages in thread
From: Andrew Lunn @ 2016-09-07  1:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 06, 2016 at 04:06:23PM +0200, Arnd Bergmann wrote:
> rd88f6183ap-ge passes NO_IRQ as the interrupt line for its m25p80
> NOR flash. However, this device never uses an interrupt and the
> driver doesn't care, so we can simply remove the deprecated constant
> here.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
  2016-09-06 14:06   ` Arnd Bergmann
@ 2016-09-07  2:03     ` Andrew Lunn
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrew Lunn @ 2016-09-07  2:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jason Cooper, Gregory Clement, Sebastian Hesselbarth,
	linux-arm-kernel, Russell King, linux-kernel

On Tue, Sep 06, 2016 at 04:06:22PM +0200, Arnd Bergmann wrote:
> As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
> IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
> normal convention of using '0' to indicate an invalid interrupt, rather
> than the deprecated NO_IRQ constant
> 
> My first approach was to pass a pointer to the resource into
> orion_ge00_switch_init(), but it seemed to just add complexity
> for no good.

Hi Arnd

You can simply this. DSA has never as far as i remember used an
interrupt passed via platform data. Two boards do seem to pass an
interrupt via a GPIO line, but it has never been used.

So if you want, you could strip all this interrupt code out.

There might be some patches coming soon which does add interrupt
support to DSA, but it will only be via device tree, since i don't
have a platform which is capable of using platform data for DSA.

   Andrew

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

* [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
@ 2016-09-07  2:03     ` Andrew Lunn
  0 siblings, 0 replies; 24+ messages in thread
From: Andrew Lunn @ 2016-09-07  2:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 06, 2016 at 04:06:22PM +0200, Arnd Bergmann wrote:
> As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
> IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
> normal convention of using '0' to indicate an invalid interrupt, rather
> than the deprecated NO_IRQ constant
> 
> My first approach was to pass a pointer to the resource into
> orion_ge00_switch_init(), but it seemed to just add complexity
> for no good.

Hi Arnd

You can simply this. DSA has never as far as i remember used an
interrupt passed via platform data. Two boards do seem to pass an
interrupt via a GPIO line, but it has never been used.

So if you want, you could strip all this interrupt code out.

There might be some patches coming soon which does add interrupt
support to DSA, but it will only be via device tree, since i don't
have a platform which is capable of using platform data for DSA.

   Andrew

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

* Re: [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
  2016-09-07  2:03     ` Andrew Lunn
@ 2016-09-08 15:20       ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-08 15:20 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrew Lunn, Jason Cooper, Russell King, linux-kernel,
	Gregory Clement, Sebastian Hesselbarth

On Wednesday, September 7, 2016 4:03:16 AM CEST Andrew Lunn wrote:
> On Tue, Sep 06, 2016 at 04:06:22PM +0200, Arnd Bergmann wrote:
> > As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
> > IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
> > normal convention of using '0' to indicate an invalid interrupt, rather
> > than the deprecated NO_IRQ constant
> > 
> > My first approach was to pass a pointer to the resource into
> > orion_ge00_switch_init(), but it seemed to just add complexity
> > for no good.
> 
> Hi Arnd
> 
> You can simply this. DSA has never as far as i remember used an
> interrupt passed via platform data. Two boards do seem to pass an
> interrupt via a GPIO line, but it has never been used.
> 
> So if you want, you could strip all this interrupt code out.
> 
> There might be some patches coming soon which does add interrupt
> support to DSA, but it will only be via device tree, since i don't
> have a platform which is capable of using platform data for DSA.

Ok, good idea!

This is what I came up with, let me know if I should repost the
whole series with this.

	Arnd

>From 75669f969287e9479f280642d251c1bac68f8d7c Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 5 Sep 2016 16:18:45 +0200
Subject: [PATCH] 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 <arnd@arndb.de>

diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 058994e99570..04910764c385 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -105,9 +105,9 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
 /*****************************************************************************
  * Ethernet switch
  ****************************************************************************/
-void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
+void __init orion5x_eth_switch_init(struct dsa_platform_data *d)
 {
-	orion_ge00_switch_init(d, irq);
+	orion_ge00_switch_init(d);
 }
 
 
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index cd0389c6e822..8a4115bd441d 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -41,7 +41,7 @@ void orion5x_setup_wins(void);
 void orion5x_ehci0_init(void);
 void orion5x_ehci1_init(void);
 void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
-void orion5x_eth_switch_init(struct dsa_platform_data *d, int irq);
+void orion5x_eth_switch_init(struct dsa_platform_data *d);
 void orion5x_i2c_init(void);
 void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
 void orion5x_spi_init(void);
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index c742e7b40b0d..dccadf68ea2b 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -101,7 +101,7 @@ static struct dsa_chip_data rd88f5181l_fxo_switch_chip_data = {
 	.port_names[7]	= "lan3",
 };
 
-static struct dsa_platform_data rd88f5181l_fxo_switch_plat_data = {
+static struct dsa_platform_data __initdata rd88f5181l_fxo_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &rd88f5181l_fxo_switch_chip_data,
 };
@@ -120,7 +120,7 @@ static void __init rd88f5181l_fxo_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f5181l_fxo_eth_data);
-	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index 7e977b794b0c..affe5ec825de 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -102,7 +102,7 @@ static struct dsa_chip_data rd88f5181l_ge_switch_chip_data = {
 	.port_names[7]	= "lan3",
 };
 
-static struct dsa_platform_data rd88f5181l_ge_switch_plat_data = {
+static struct dsa_platform_data __initdata rd88f5181l_ge_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &rd88f5181l_ge_switch_chip_data,
 };
@@ -125,8 +125,7 @@ static void __init rd88f5181l_ge_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f5181l_ge_eth_data);
-	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data,
-				gpio_to_irq(8));
+	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data);
 	orion5x_i2c_init();
 	orion5x_uart0_init();
 
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 8ffaead76771..67ee8571b03c 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -40,7 +40,7 @@ static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
 	.port_names[5]	= "cpu",
 };
 
-static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
+static struct dsa_platform_data __initdata rd88f6183ap_ge_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &rd88f6183ap_ge_switch_chip_data,
 };
@@ -89,8 +89,7 @@ static void __init rd88f6183ap_ge_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f6183ap_ge_eth_data);
-	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
-				gpio_to_irq(3));
+	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data);
 	spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
 				ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
 	orion5x_spi_init();
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 4e1e5c8f6111..4dbcdbe1de7c 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -106,7 +106,7 @@ static struct dsa_chip_data wnr854t_switch_chip_data = {
 	.port_names[7] = "lan2",
 };
 
-static struct dsa_platform_data wnr854t_switch_plat_data = {
+static struct dsa_platform_data __initdata wnr854t_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &wnr854t_switch_chip_data,
 };
@@ -124,7 +124,7 @@ static void __init wnr854t_init(void)
 	 * Configure peripherals.
 	 */
 	orion5x_eth_init(&wnr854t_eth_data);
-	orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wnr854t_switch_plat_data);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 61e9027ef224..a6a8c4648d74 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -191,7 +191,7 @@ static struct dsa_chip_data wrt350n_v2_switch_chip_data = {
 	.port_names[7]	= "lan4",
 };
 
-static struct dsa_platform_data wrt350n_v2_switch_plat_data = {
+static struct dsa_platform_data __initdata wrt350n_v2_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &wrt350n_v2_switch_chip_data,
 };
@@ -210,7 +210,7 @@ static void __init wrt350n_v2_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&wrt350n_v2_eth_data);
-	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
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,

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

* [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
@ 2016-09-08 15:20       ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2016-09-08 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, September 7, 2016 4:03:16 AM CEST Andrew Lunn wrote:
> On Tue, Sep 06, 2016 at 04:06:22PM +0200, Arnd Bergmann wrote:
> > As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
> > IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
> > normal convention of using '0' to indicate an invalid interrupt, rather
> > than the deprecated NO_IRQ constant
> > 
> > My first approach was to pass a pointer to the resource into
> > orion_ge00_switch_init(), but it seemed to just add complexity
> > for no good.
> 
> Hi Arnd
> 
> You can simply this. DSA has never as far as i remember used an
> interrupt passed via platform data. Two boards do seem to pass an
> interrupt via a GPIO line, but it has never been used.
> 
> So if you want, you could strip all this interrupt code out.
> 
> There might be some patches coming soon which does add interrupt
> support to DSA, but it will only be via device tree, since i don't
> have a platform which is capable of using platform data for DSA.

Ok, good idea!

This is what I came up with, let me know if I should repost the
whole series with this.

	Arnd

>From 75669f969287e9479f280642d251c1bac68f8d7c Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 5 Sep 2016 16:18:45 +0200
Subject: [PATCH] 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 <arnd@arndb.de>

diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 058994e99570..04910764c385 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -105,9 +105,9 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
 /*****************************************************************************
  * Ethernet switch
  ****************************************************************************/
-void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
+void __init orion5x_eth_switch_init(struct dsa_platform_data *d)
 {
-	orion_ge00_switch_init(d, irq);
+	orion_ge00_switch_init(d);
 }
 
 
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index cd0389c6e822..8a4115bd441d 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -41,7 +41,7 @@ void orion5x_setup_wins(void);
 void orion5x_ehci0_init(void);
 void orion5x_ehci1_init(void);
 void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
-void orion5x_eth_switch_init(struct dsa_platform_data *d, int irq);
+void orion5x_eth_switch_init(struct dsa_platform_data *d);
 void orion5x_i2c_init(void);
 void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
 void orion5x_spi_init(void);
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index c742e7b40b0d..dccadf68ea2b 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -101,7 +101,7 @@ static struct dsa_chip_data rd88f5181l_fxo_switch_chip_data = {
 	.port_names[7]	= "lan3",
 };
 
-static struct dsa_platform_data rd88f5181l_fxo_switch_plat_data = {
+static struct dsa_platform_data __initdata rd88f5181l_fxo_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &rd88f5181l_fxo_switch_chip_data,
 };
@@ -120,7 +120,7 @@ static void __init rd88f5181l_fxo_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f5181l_fxo_eth_data);
-	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index 7e977b794b0c..affe5ec825de 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -102,7 +102,7 @@ static struct dsa_chip_data rd88f5181l_ge_switch_chip_data = {
 	.port_names[7]	= "lan3",
 };
 
-static struct dsa_platform_data rd88f5181l_ge_switch_plat_data = {
+static struct dsa_platform_data __initdata rd88f5181l_ge_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &rd88f5181l_ge_switch_chip_data,
 };
@@ -125,8 +125,7 @@ static void __init rd88f5181l_ge_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f5181l_ge_eth_data);
-	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data,
-				gpio_to_irq(8));
+	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data);
 	orion5x_i2c_init();
 	orion5x_uart0_init();
 
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 8ffaead76771..67ee8571b03c 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -40,7 +40,7 @@ static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
 	.port_names[5]	= "cpu",
 };
 
-static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
+static struct dsa_platform_data __initdata rd88f6183ap_ge_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &rd88f6183ap_ge_switch_chip_data,
 };
@@ -89,8 +89,7 @@ static void __init rd88f6183ap_ge_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&rd88f6183ap_ge_eth_data);
-	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
-				gpio_to_irq(3));
+	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data);
 	spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
 				ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
 	orion5x_spi_init();
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 4e1e5c8f6111..4dbcdbe1de7c 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -106,7 +106,7 @@ static struct dsa_chip_data wnr854t_switch_chip_data = {
 	.port_names[7] = "lan2",
 };
 
-static struct dsa_platform_data wnr854t_switch_plat_data = {
+static struct dsa_platform_data __initdata wnr854t_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &wnr854t_switch_chip_data,
 };
@@ -124,7 +124,7 @@ static void __init wnr854t_init(void)
 	 * Configure peripherals.
 	 */
 	orion5x_eth_init(&wnr854t_eth_data);
-	orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wnr854t_switch_plat_data);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 61e9027ef224..a6a8c4648d74 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -191,7 +191,7 @@ static struct dsa_chip_data wrt350n_v2_switch_chip_data = {
 	.port_names[7]	= "lan4",
 };
 
-static struct dsa_platform_data wrt350n_v2_switch_plat_data = {
+static struct dsa_platform_data __initdata wrt350n_v2_switch_plat_data = {
 	.nr_chips	= 1,
 	.chip		= &wrt350n_v2_switch_chip_data,
 };
@@ -210,7 +210,7 @@ static void __init wrt350n_v2_init(void)
 	 */
 	orion5x_ehci0_init();
 	orion5x_eth_init(&wrt350n_v2_eth_data);
-	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
+	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data);
 	orion5x_uart0_init();
 
 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
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,

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

* Re: [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation
  2016-09-06 14:06 ` Arnd Bergmann
@ 2016-09-14 14:37   ` Gregory CLEMENT
  -1 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	linux-arm-kernel, Russell King, linux-kernel

Hi Arnd,
 
 On mar., sept. 06 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> Out of the four ethernet devices on mv78xx0, only the first one
> has an error interrupt line, for the other ones we pass NO_IRQ
> and then ignore the argument.
>
> In order to get closer to complete remove of NO_IRQ, this simply
> drops the unused function arguments.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied on mvebu/soc with Reviewed-by tag from  Andrew Lunn

Thanks,

Gregory

> ---
>  arch/arm/mach-mv78xx0/common.c            | 9 ++-------
>  arch/arm/plat-orion/common.c              | 7 ++-----
>  arch/arm/plat-orion/include/plat/common.h | 7 ++-----
>  3 files changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
> index 6af5430d0d97..f72e1e9f5fc5 100644
> --- a/arch/arm/mach-mv78xx0/common.c
> +++ b/arch/arm/mach-mv78xx0/common.c
> @@ -219,7 +219,6 @@ void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data)
>  {
>  	orion_ge01_init(eth_data,
>  			GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM,
> -			NO_IRQ,
>  			MV643XX_TX_CSUM_DEFAULT_LIMIT);
>  }
>  
> @@ -242,9 +241,7 @@ void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
>  		eth_data->duplex = DUPLEX_FULL;
>  	}
>  
> -	orion_ge10_init(eth_data,
> -			GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM,
> -			NO_IRQ);
> +	orion_ge10_init(eth_data, GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM);
>  }
>  
>  
> @@ -266,9 +263,7 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
>  		eth_data->duplex = DUPLEX_FULL;
>  	}
>  
> -	orion_ge11_init(eth_data,
> -			GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM,
> -			NO_IRQ);
> +	orion_ge11_init(eth_data, GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM);
>  }
>  
>  /*****************************************************************************
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index 78c8bf4043c0..7757f71fe709 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -354,7 +354,6 @@ static struct platform_device orion_ge01 = {
>  void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
>  			    unsigned long irq,
> -			    unsigned long irq_err,
>  			    unsigned int tx_csum_limit)
>  {
>  	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
> @@ -404,8 +403,7 @@ static struct platform_device orion_ge10 = {
>  
>  void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err)
> +			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
>  		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> @@ -453,8 +451,7 @@ static struct platform_device orion_ge11 = {
>  
>  void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err)
> +			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
>  		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h
> index 9e6d76ad48a9..8519727faa5e 100644
> --- a/arch/arm/plat-orion/include/plat/common.h
> +++ b/arch/arm/plat-orion/include/plat/common.h
> @@ -47,18 +47,15 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
>  void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
>  			    unsigned long irq,
> -			    unsigned long irq_err,
>  			    unsigned int tx_csum_limit);
>  
>  void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err);
> +			    unsigned long irq);
>  
>  void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err);
> +			    unsigned long irq);
>  
>  void __init orion_ge00_switch_init(struct dsa_platform_data *d,
>  				   int irq);
> -- 
> 2.9.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation
@ 2016-09-14 14:37   ` Gregory CLEMENT
  0 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,
 
 On mar., sept. 06 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> Out of the four ethernet devices on mv78xx0, only the first one
> has an error interrupt line, for the other ones we pass NO_IRQ
> and then ignore the argument.
>
> In order to get closer to complete remove of NO_IRQ, this simply
> drops the unused function arguments.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied on mvebu/soc with Reviewed-by tag from  Andrew Lunn

Thanks,

Gregory

> ---
>  arch/arm/mach-mv78xx0/common.c            | 9 ++-------
>  arch/arm/plat-orion/common.c              | 7 ++-----
>  arch/arm/plat-orion/include/plat/common.h | 7 ++-----
>  3 files changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
> index 6af5430d0d97..f72e1e9f5fc5 100644
> --- a/arch/arm/mach-mv78xx0/common.c
> +++ b/arch/arm/mach-mv78xx0/common.c
> @@ -219,7 +219,6 @@ void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data)
>  {
>  	orion_ge01_init(eth_data,
>  			GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM,
> -			NO_IRQ,
>  			MV643XX_TX_CSUM_DEFAULT_LIMIT);
>  }
>  
> @@ -242,9 +241,7 @@ void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
>  		eth_data->duplex = DUPLEX_FULL;
>  	}
>  
> -	orion_ge10_init(eth_data,
> -			GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM,
> -			NO_IRQ);
> +	orion_ge10_init(eth_data, GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM);
>  }
>  
>  
> @@ -266,9 +263,7 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
>  		eth_data->duplex = DUPLEX_FULL;
>  	}
>  
> -	orion_ge11_init(eth_data,
> -			GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM,
> -			NO_IRQ);
> +	orion_ge11_init(eth_data, GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM);
>  }
>  
>  /*****************************************************************************
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index 78c8bf4043c0..7757f71fe709 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -354,7 +354,6 @@ static struct platform_device orion_ge01 = {
>  void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
>  			    unsigned long irq,
> -			    unsigned long irq_err,
>  			    unsigned int tx_csum_limit)
>  {
>  	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
> @@ -404,8 +403,7 @@ static struct platform_device orion_ge10 = {
>  
>  void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err)
> +			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
>  		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> @@ -453,8 +451,7 @@ static struct platform_device orion_ge11 = {
>  
>  void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err)
> +			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
>  		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h
> index 9e6d76ad48a9..8519727faa5e 100644
> --- a/arch/arm/plat-orion/include/plat/common.h
> +++ b/arch/arm/plat-orion/include/plat/common.h
> @@ -47,18 +47,15 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
>  void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
>  			    unsigned long irq,
> -			    unsigned long irq_err,
>  			    unsigned int tx_csum_limit);
>  
>  void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err);
> +			    unsigned long irq);
>  
>  void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long mapbase,
> -			    unsigned long irq,
> -			    unsigned long irq_err);
> +			    unsigned long irq);
>  
>  void __init orion_ge00_switch_init(struct dsa_platform_data *d,
>  				   int irq);
> -- 
> 2.9.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 2/4] ARM: mvebu/orion: remove NO_IRQ check from device init
  2016-09-06 14:06   ` Arnd Bergmann
@ 2016-09-14 14:37     ` Gregory CLEMENT
  -1 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	linux-arm-kernel, Russell King, linux-kernel

Hi Arnd,
 
 On mar., sept. 06 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> For most devices, we know in advance whether they have an
> interrupt line or not, so we can avoid passing NO_IRQ and
> instead split fill_resources() into two interfaces, with
> only the new fill_resources_irq() function taking an irq
> argument, which it then can use unconditionally.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied on mvebu/soc

Thanks,

Gregory
> ---
>  arch/arm/plat-orion/common.c | 52 ++++++++++++++++++++++++--------------------
>  1 file changed, 29 insertions(+), 23 deletions(-)
>
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index 7757f71fe709..7b9b70785a54 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -52,21 +52,27 @@ void __init orion_clkdev_init(struct clk *tclk)
>  static void fill_resources(struct platform_device *device,
>  			   struct resource *resources,
>  			   resource_size_t mapbase,
> -			   resource_size_t size,
> -			   unsigned int irq)
> +			   resource_size_t size)
>  {
>  	device->resource = resources;
>  	device->num_resources = 1;
>  	resources[0].flags = IORESOURCE_MEM;
>  	resources[0].start = mapbase;
>  	resources[0].end = mapbase + size;
> +}
>  
> -	if (irq != NO_IRQ) {
> -		device->num_resources++;
> -		resources[1].flags = IORESOURCE_IRQ;
> -		resources[1].start = irq;
> -		resources[1].end = irq;
> -	}
> +static void fill_resources_irq(struct platform_device *device,
> +			       struct resource *resources,
> +			       resource_size_t mapbase,
> +			       resource_size_t size,
> +			       unsigned int irq)
> +{
> +	fill_resources(device, resources, mapbase, size);
> +
> +	device->num_resources++;
> +	resources[1].flags = IORESOURCE_IRQ;
> +	resources[1].start = irq;
> +	resources[1].end = irq;
>  }
>  
>  /*****************************************************************************
> @@ -93,7 +99,7 @@ static void __init uart_complete(
>  	data->uartclk = uart_get_clk_rate(clk);
>  	orion_uart->dev.platform_data = data;
>  
> -	fill_resources(orion_uart, resources, mapbase, 0xff, irq);
> +	fill_resources_irq(orion_uart, resources, mapbase, 0xff, irq);
>  	platform_device_register(orion_uart);
>  }
>  
> @@ -305,8 +311,8 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned int tx_csum_limit)
>  {
>  	fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> -	fill_resources(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
> +		       mapbase + 0x2000, SZ_16K - 1);
> +	fill_resources_irq(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
>  			mapbase + 0x2004, 0x84 - 1, irq_err);
>  	orion_ge00_shared_data.tx_csum_limit = tx_csum_limit;
>  	ge_complete(&orion_ge00_shared_data,
> @@ -357,7 +363,7 @@ void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned int tx_csum_limit)
>  {
>  	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> +		       mapbase + 0x2000, SZ_16K - 1);
>  	orion_ge01_shared_data.tx_csum_limit = tx_csum_limit;
>  	ge_complete(&orion_ge01_shared_data,
>  		    orion_ge01_resources, irq, &orion_ge01_shared,
> @@ -406,7 +412,7 @@ void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> +		       mapbase + 0x2000, SZ_16K - 1);
>  	ge_complete(&orion_ge10_shared_data,
>  		    orion_ge10_resources, irq, &orion_ge10_shared,
>  		    NULL,
> @@ -454,7 +460,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> +		       mapbase + 0x2000, SZ_16K - 1);
>  	ge_complete(&orion_ge11_shared_data,
>  		    orion_ge11_resources, irq, &orion_ge11_shared,
>  		    NULL,
> @@ -535,7 +541,7 @@ void __init orion_i2c_init(unsigned long mapbase,
>  			   unsigned long freq_m)
>  {
>  	orion_i2c_pdata.freq_m = freq_m;
> -	fill_resources(&orion_i2c, orion_i2c_resources, mapbase,
> +	fill_resources_irq(&orion_i2c, orion_i2c_resources, mapbase,
>  		       SZ_32 - 1, irq);
>  	platform_device_register(&orion_i2c);
>  }
> @@ -545,7 +551,7 @@ void __init orion_i2c_1_init(unsigned long mapbase,
>  			     unsigned long freq_m)
>  {
>  	orion_i2c_1_pdata.freq_m = freq_m;
> -	fill_resources(&orion_i2c_1, orion_i2c_1_resources, mapbase,
> +	fill_resources_irq(&orion_i2c_1, orion_i2c_1_resources, mapbase,
>  		       SZ_32 - 1, irq);
>  	platform_device_register(&orion_i2c_1);
>  }
> @@ -573,14 +579,14 @@ static struct platform_device orion_spi_1 = {
>  void __init orion_spi_init(unsigned long mapbase)
>  {
>  	fill_resources(&orion_spi, &orion_spi_resources,
> -		       mapbase, SZ_512 - 1, NO_IRQ);
> +		       mapbase, SZ_512 - 1);
>  	platform_device_register(&orion_spi);
>  }
>  
>  void __init orion_spi_1_init(unsigned long mapbase)
>  {
>  	fill_resources(&orion_spi_1, &orion_spi_1_resources,
> -		       mapbase, SZ_512 - 1, NO_IRQ);
> +		       mapbase, SZ_512 - 1);
>  	platform_device_register(&orion_spi_1);
>  }
>  
> @@ -738,7 +744,7 @@ void __init orion_ehci_init(unsigned long mapbase,
>  			    enum orion_ehci_phy_ver phy_version)
>  {
>  	orion_ehci_data.phy_version = phy_version;
> -	fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
> +	fill_resources_irq(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
>  		       irq);
>  
>  	platform_device_register(&orion_ehci);
> @@ -762,7 +768,7 @@ static struct platform_device orion_ehci_1 = {
>  void __init orion_ehci_1_init(unsigned long mapbase,
>  			      unsigned long irq)
>  {
> -	fill_resources(&orion_ehci_1, orion_ehci_1_resources,
> +	fill_resources_irq(&orion_ehci_1, orion_ehci_1_resources,
>  		       mapbase, SZ_4K - 1, irq);
>  
>  	platform_device_register(&orion_ehci_1);
> @@ -786,7 +792,7 @@ static struct platform_device orion_ehci_2 = {
>  void __init orion_ehci_2_init(unsigned long mapbase,
>  			      unsigned long irq)
>  {
> -	fill_resources(&orion_ehci_2, orion_ehci_2_resources,
> +	fill_resources_irq(&orion_ehci_2, orion_ehci_2_resources,
>  		       mapbase, SZ_4K - 1, irq);
>  
>  	platform_device_register(&orion_ehci_2);
> @@ -816,7 +822,7 @@ void __init orion_sata_init(struct mv_sata_platform_data *sata_data,
>  			    unsigned long irq)
>  {
>  	orion_sata.dev.platform_data = sata_data;
> -	fill_resources(&orion_sata, orion_sata_resources,
> +	fill_resources_irq(&orion_sata, orion_sata_resources,
>  		       mapbase, 0x5000 - 1, irq);
>  
>  	platform_device_register(&orion_sata);
> @@ -846,7 +852,7 @@ void __init orion_crypto_init(unsigned long mapbase,
>  			      unsigned long sram_size,
>  			      unsigned long irq)
>  {
> -	fill_resources(&orion_crypto, orion_crypto_resources,
> +	fill_resources_irq(&orion_crypto, orion_crypto_resources,
>  		       mapbase, 0xffff, irq);
>  	orion_crypto.num_resources = 3;
>  	orion_crypto_resources[2].start = srambase;
> -- 
> 2.9.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH 2/4] ARM: mvebu/orion: remove NO_IRQ check from device init
@ 2016-09-14 14:37     ` Gregory CLEMENT
  0 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,
 
 On mar., sept. 06 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> For most devices, we know in advance whether they have an
> interrupt line or not, so we can avoid passing NO_IRQ and
> instead split fill_resources() into two interfaces, with
> only the new fill_resources_irq() function taking an irq
> argument, which it then can use unconditionally.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied on mvebu/soc

Thanks,

Gregory
> ---
>  arch/arm/plat-orion/common.c | 52 ++++++++++++++++++++++++--------------------
>  1 file changed, 29 insertions(+), 23 deletions(-)
>
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index 7757f71fe709..7b9b70785a54 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -52,21 +52,27 @@ void __init orion_clkdev_init(struct clk *tclk)
>  static void fill_resources(struct platform_device *device,
>  			   struct resource *resources,
>  			   resource_size_t mapbase,
> -			   resource_size_t size,
> -			   unsigned int irq)
> +			   resource_size_t size)
>  {
>  	device->resource = resources;
>  	device->num_resources = 1;
>  	resources[0].flags = IORESOURCE_MEM;
>  	resources[0].start = mapbase;
>  	resources[0].end = mapbase + size;
> +}
>  
> -	if (irq != NO_IRQ) {
> -		device->num_resources++;
> -		resources[1].flags = IORESOURCE_IRQ;
> -		resources[1].start = irq;
> -		resources[1].end = irq;
> -	}
> +static void fill_resources_irq(struct platform_device *device,
> +			       struct resource *resources,
> +			       resource_size_t mapbase,
> +			       resource_size_t size,
> +			       unsigned int irq)
> +{
> +	fill_resources(device, resources, mapbase, size);
> +
> +	device->num_resources++;
> +	resources[1].flags = IORESOURCE_IRQ;
> +	resources[1].start = irq;
> +	resources[1].end = irq;
>  }
>  
>  /*****************************************************************************
> @@ -93,7 +99,7 @@ static void __init uart_complete(
>  	data->uartclk = uart_get_clk_rate(clk);
>  	orion_uart->dev.platform_data = data;
>  
> -	fill_resources(orion_uart, resources, mapbase, 0xff, irq);
> +	fill_resources_irq(orion_uart, resources, mapbase, 0xff, irq);
>  	platform_device_register(orion_uart);
>  }
>  
> @@ -305,8 +311,8 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned int tx_csum_limit)
>  {
>  	fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> -	fill_resources(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
> +		       mapbase + 0x2000, SZ_16K - 1);
> +	fill_resources_irq(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
>  			mapbase + 0x2004, 0x84 - 1, irq_err);
>  	orion_ge00_shared_data.tx_csum_limit = tx_csum_limit;
>  	ge_complete(&orion_ge00_shared_data,
> @@ -357,7 +363,7 @@ void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned int tx_csum_limit)
>  {
>  	fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> +		       mapbase + 0x2000, SZ_16K - 1);
>  	orion_ge01_shared_data.tx_csum_limit = tx_csum_limit;
>  	ge_complete(&orion_ge01_shared_data,
>  		    orion_ge01_resources, irq, &orion_ge01_shared,
> @@ -406,7 +412,7 @@ void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> +		       mapbase + 0x2000, SZ_16K - 1);
>  	ge_complete(&orion_ge10_shared_data,
>  		    orion_ge10_resources, irq, &orion_ge10_shared,
>  		    NULL,
> @@ -454,7 +460,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
>  			    unsigned long irq)
>  {
>  	fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
> -		       mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
> +		       mapbase + 0x2000, SZ_16K - 1);
>  	ge_complete(&orion_ge11_shared_data,
>  		    orion_ge11_resources, irq, &orion_ge11_shared,
>  		    NULL,
> @@ -535,7 +541,7 @@ void __init orion_i2c_init(unsigned long mapbase,
>  			   unsigned long freq_m)
>  {
>  	orion_i2c_pdata.freq_m = freq_m;
> -	fill_resources(&orion_i2c, orion_i2c_resources, mapbase,
> +	fill_resources_irq(&orion_i2c, orion_i2c_resources, mapbase,
>  		       SZ_32 - 1, irq);
>  	platform_device_register(&orion_i2c);
>  }
> @@ -545,7 +551,7 @@ void __init orion_i2c_1_init(unsigned long mapbase,
>  			     unsigned long freq_m)
>  {
>  	orion_i2c_1_pdata.freq_m = freq_m;
> -	fill_resources(&orion_i2c_1, orion_i2c_1_resources, mapbase,
> +	fill_resources_irq(&orion_i2c_1, orion_i2c_1_resources, mapbase,
>  		       SZ_32 - 1, irq);
>  	platform_device_register(&orion_i2c_1);
>  }
> @@ -573,14 +579,14 @@ static struct platform_device orion_spi_1 = {
>  void __init orion_spi_init(unsigned long mapbase)
>  {
>  	fill_resources(&orion_spi, &orion_spi_resources,
> -		       mapbase, SZ_512 - 1, NO_IRQ);
> +		       mapbase, SZ_512 - 1);
>  	platform_device_register(&orion_spi);
>  }
>  
>  void __init orion_spi_1_init(unsigned long mapbase)
>  {
>  	fill_resources(&orion_spi_1, &orion_spi_1_resources,
> -		       mapbase, SZ_512 - 1, NO_IRQ);
> +		       mapbase, SZ_512 - 1);
>  	platform_device_register(&orion_spi_1);
>  }
>  
> @@ -738,7 +744,7 @@ void __init orion_ehci_init(unsigned long mapbase,
>  			    enum orion_ehci_phy_ver phy_version)
>  {
>  	orion_ehci_data.phy_version = phy_version;
> -	fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
> +	fill_resources_irq(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
>  		       irq);
>  
>  	platform_device_register(&orion_ehci);
> @@ -762,7 +768,7 @@ static struct platform_device orion_ehci_1 = {
>  void __init orion_ehci_1_init(unsigned long mapbase,
>  			      unsigned long irq)
>  {
> -	fill_resources(&orion_ehci_1, orion_ehci_1_resources,
> +	fill_resources_irq(&orion_ehci_1, orion_ehci_1_resources,
>  		       mapbase, SZ_4K - 1, irq);
>  
>  	platform_device_register(&orion_ehci_1);
> @@ -786,7 +792,7 @@ static struct platform_device orion_ehci_2 = {
>  void __init orion_ehci_2_init(unsigned long mapbase,
>  			      unsigned long irq)
>  {
> -	fill_resources(&orion_ehci_2, orion_ehci_2_resources,
> +	fill_resources_irq(&orion_ehci_2, orion_ehci_2_resources,
>  		       mapbase, SZ_4K - 1, irq);
>  
>  	platform_device_register(&orion_ehci_2);
> @@ -816,7 +822,7 @@ void __init orion_sata_init(struct mv_sata_platform_data *sata_data,
>  			    unsigned long irq)
>  {
>  	orion_sata.dev.platform_data = sata_data;
> -	fill_resources(&orion_sata, orion_sata_resources,
> +	fill_resources_irq(&orion_sata, orion_sata_resources,
>  		       mapbase, 0x5000 - 1, irq);
>  
>  	platform_device_register(&orion_sata);
> @@ -846,7 +852,7 @@ void __init orion_crypto_init(unsigned long mapbase,
>  			      unsigned long sram_size,
>  			      unsigned long irq)
>  {
> -	fill_resources(&orion_crypto, orion_crypto_resources,
> +	fill_resources_irq(&orion_crypto, orion_crypto_resources,
>  		       mapbase, 0xffff, irq);
>  	orion_crypto.num_resources = 3;
>  	orion_crypto_resources[2].start = srambase;
> -- 
> 2.9.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
  2016-09-08 15:20       ` Arnd Bergmann
@ 2016-09-14 14:37         ` Gregory CLEMENT
  -1 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, Andrew Lunn, Jason Cooper, Russell King,
	linux-kernel, Sebastian Hesselbarth

Hi Arnd,
 
 On jeu., sept. 08 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> On Wednesday, September 7, 2016 4:03:16 AM CEST Andrew Lunn wrote:
>> On Tue, Sep 06, 2016 at 04:06:22PM +0200, Arnd Bergmann wrote:
>> > As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
>> > IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
>> > normal convention of using '0' to indicate an invalid interrupt, rather
>> > than the deprecated NO_IRQ constant
>> > 
>> > My first approach was to pass a pointer to the resource into
>> > orion_ge00_switch_init(), but it seemed to just add complexity
>> > for no good.
>> 
>> Hi Arnd
>> 
>> You can simply this. DSA has never as far as i remember used an
>> interrupt passed via platform data. Two boards do seem to pass an
>> interrupt via a GPIO line, but it has never been used.
>> 
>> So if you want, you could strip all this interrupt code out.
>> 
>> There might be some patches coming soon which does add interrupt
>> support to DSA, but it will only be via device tree, since i don't
>> have a platform which is capable of using platform data for DSA.
>
> Ok, good idea!
>
> This is what I came up with, let me know if I should repost the
> whole series with this.
>
> 	Arnd
>
> From 75669f969287e9479f280642d251c1bac68f8d7c Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Mon, 5 Sep 2016 16:18:45 +0200
> Subject: [PATCH] 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 <arnd@arndb.de>


I applied this version f the patch on mvebu/soc

Thanks,

Gregory

>
> diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
> index 058994e99570..04910764c385 100644
> --- a/arch/arm/mach-orion5x/common.c
> +++ b/arch/arm/mach-orion5x/common.c
> @@ -105,9 +105,9 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
>  /*****************************************************************************
>   * Ethernet switch
>   ****************************************************************************/
> -void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
> +void __init orion5x_eth_switch_init(struct dsa_platform_data *d)
>  {
> -	orion_ge00_switch_init(d, irq);
> +	orion_ge00_switch_init(d);
>  }
>  
>  
> diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
> index cd0389c6e822..8a4115bd441d 100644
> --- a/arch/arm/mach-orion5x/common.h
> +++ b/arch/arm/mach-orion5x/common.h
> @@ -41,7 +41,7 @@ void orion5x_setup_wins(void);
>  void orion5x_ehci0_init(void);
>  void orion5x_ehci1_init(void);
>  void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
> -void orion5x_eth_switch_init(struct dsa_platform_data *d, int irq);
> +void orion5x_eth_switch_init(struct dsa_platform_data *d);
>  void orion5x_i2c_init(void);
>  void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
>  void orion5x_spi_init(void);
> diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
> index c742e7b40b0d..dccadf68ea2b 100644
> --- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
> @@ -101,7 +101,7 @@ static struct dsa_chip_data rd88f5181l_fxo_switch_chip_data = {
>  	.port_names[7]	= "lan3",
>  };
>  
> -static struct dsa_platform_data rd88f5181l_fxo_switch_plat_data = {
> +static struct dsa_platform_data __initdata rd88f5181l_fxo_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &rd88f5181l_fxo_switch_chip_data,
>  };
> @@ -120,7 +120,7 @@ static void __init rd88f5181l_fxo_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&rd88f5181l_fxo_eth_data);
> -	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
> +	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data);
>  	orion5x_uart0_init();
>  
>  	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
> diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
> index 7e977b794b0c..affe5ec825de 100644
> --- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
> @@ -102,7 +102,7 @@ static struct dsa_chip_data rd88f5181l_ge_switch_chip_data = {
>  	.port_names[7]	= "lan3",
>  };
>  
> -static struct dsa_platform_data rd88f5181l_ge_switch_plat_data = {
> +static struct dsa_platform_data __initdata rd88f5181l_ge_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &rd88f5181l_ge_switch_chip_data,
>  };
> @@ -125,8 +125,7 @@ static void __init rd88f5181l_ge_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&rd88f5181l_ge_eth_data);
> -	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data,
> -				gpio_to_irq(8));
> +	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data);
>  	orion5x_i2c_init();
>  	orion5x_uart0_init();
>  
> diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> index 8ffaead76771..67ee8571b03c 100644
> --- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> @@ -40,7 +40,7 @@ static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
>  	.port_names[5]	= "cpu",
>  };
>  
> -static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
> +static struct dsa_platform_data __initdata rd88f6183ap_ge_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &rd88f6183ap_ge_switch_chip_data,
>  };
> @@ -89,8 +89,7 @@ static void __init rd88f6183ap_ge_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&rd88f6183ap_ge_eth_data);
> -	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
> -				gpio_to_irq(3));
> +	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data);
>  	spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
>  				ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
>  	orion5x_spi_init();
> diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
> index 4e1e5c8f6111..4dbcdbe1de7c 100644
> --- a/arch/arm/mach-orion5x/wnr854t-setup.c
> +++ b/arch/arm/mach-orion5x/wnr854t-setup.c
> @@ -106,7 +106,7 @@ static struct dsa_chip_data wnr854t_switch_chip_data = {
>  	.port_names[7] = "lan2",
>  };
>  
> -static struct dsa_platform_data wnr854t_switch_plat_data = {
> +static struct dsa_platform_data __initdata wnr854t_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &wnr854t_switch_chip_data,
>  };
> @@ -124,7 +124,7 @@ static void __init wnr854t_init(void)
>  	 * Configure peripherals.
>  	 */
>  	orion5x_eth_init(&wnr854t_eth_data);
> -	orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
> +	orion5x_eth_switch_init(&wnr854t_switch_plat_data);
>  	orion5x_uart0_init();
>  
>  	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
> diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
> index 61e9027ef224..a6a8c4648d74 100644
> --- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
> +++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
> @@ -191,7 +191,7 @@ static struct dsa_chip_data wrt350n_v2_switch_chip_data = {
>  	.port_names[7]	= "lan4",
>  };
>  
> -static struct dsa_platform_data wrt350n_v2_switch_plat_data = {
> +static struct dsa_platform_data __initdata wrt350n_v2_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &wrt350n_v2_switch_chip_data,
>  };
> @@ -210,7 +210,7 @@ static void __init wrt350n_v2_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&wrt350n_v2_eth_data);
> -	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
> +	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data);
>  	orion5x_uart0_init();
>  
>  	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
> 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,
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init
@ 2016-09-14 14:37         ` Gregory CLEMENT
  0 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,
 
 On jeu., sept. 08 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> On Wednesday, September 7, 2016 4:03:16 AM CEST Andrew Lunn wrote:
>> On Tue, Sep 06, 2016 at 04:06:22PM +0200, Arnd Bergmann wrote:
>> > As of commit 5be9fc23cdb4 ("ARM: orion5x: fix legacy orion5x IRQ numbers"),
>> > IRQ zero is no longer a valid interrupt on Orion5x, so we can use the
>> > normal convention of using '0' to indicate an invalid interrupt, rather
>> > than the deprecated NO_IRQ constant
>> > 
>> > My first approach was to pass a pointer to the resource into
>> > orion_ge00_switch_init(), but it seemed to just add complexity
>> > for no good.
>> 
>> Hi Arnd
>> 
>> You can simply this. DSA has never as far as i remember used an
>> interrupt passed via platform data. Two boards do seem to pass an
>> interrupt via a GPIO line, but it has never been used.
>> 
>> So if you want, you could strip all this interrupt code out.
>> 
>> There might be some patches coming soon which does add interrupt
>> support to DSA, but it will only be via device tree, since i don't
>> have a platform which is capable of using platform data for DSA.
>
> Ok, good idea!
>
> This is what I came up with, let me know if I should repost the
> whole series with this.
>
> 	Arnd
>
> From 75669f969287e9479f280642d251c1bac68f8d7c Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Mon, 5 Sep 2016 16:18:45 +0200
> Subject: [PATCH] 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 <arnd@arndb.de>


I applied this version f the patch on mvebu/soc

Thanks,

Gregory

>
> diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
> index 058994e99570..04910764c385 100644
> --- a/arch/arm/mach-orion5x/common.c
> +++ b/arch/arm/mach-orion5x/common.c
> @@ -105,9 +105,9 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
>  /*****************************************************************************
>   * Ethernet switch
>   ****************************************************************************/
> -void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
> +void __init orion5x_eth_switch_init(struct dsa_platform_data *d)
>  {
> -	orion_ge00_switch_init(d, irq);
> +	orion_ge00_switch_init(d);
>  }
>  
>  
> diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
> index cd0389c6e822..8a4115bd441d 100644
> --- a/arch/arm/mach-orion5x/common.h
> +++ b/arch/arm/mach-orion5x/common.h
> @@ -41,7 +41,7 @@ void orion5x_setup_wins(void);
>  void orion5x_ehci0_init(void);
>  void orion5x_ehci1_init(void);
>  void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
> -void orion5x_eth_switch_init(struct dsa_platform_data *d, int irq);
> +void orion5x_eth_switch_init(struct dsa_platform_data *d);
>  void orion5x_i2c_init(void);
>  void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
>  void orion5x_spi_init(void);
> diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
> index c742e7b40b0d..dccadf68ea2b 100644
> --- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
> @@ -101,7 +101,7 @@ static struct dsa_chip_data rd88f5181l_fxo_switch_chip_data = {
>  	.port_names[7]	= "lan3",
>  };
>  
> -static struct dsa_platform_data rd88f5181l_fxo_switch_plat_data = {
> +static struct dsa_platform_data __initdata rd88f5181l_fxo_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &rd88f5181l_fxo_switch_chip_data,
>  };
> @@ -120,7 +120,7 @@ static void __init rd88f5181l_fxo_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&rd88f5181l_fxo_eth_data);
> -	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
> +	orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data);
>  	orion5x_uart0_init();
>  
>  	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
> diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
> index 7e977b794b0c..affe5ec825de 100644
> --- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
> @@ -102,7 +102,7 @@ static struct dsa_chip_data rd88f5181l_ge_switch_chip_data = {
>  	.port_names[7]	= "lan3",
>  };
>  
> -static struct dsa_platform_data rd88f5181l_ge_switch_plat_data = {
> +static struct dsa_platform_data __initdata rd88f5181l_ge_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &rd88f5181l_ge_switch_chip_data,
>  };
> @@ -125,8 +125,7 @@ static void __init rd88f5181l_ge_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&rd88f5181l_ge_eth_data);
> -	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data,
> -				gpio_to_irq(8));
> +	orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data);
>  	orion5x_i2c_init();
>  	orion5x_uart0_init();
>  
> diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> index 8ffaead76771..67ee8571b03c 100644
> --- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> @@ -40,7 +40,7 @@ static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
>  	.port_names[5]	= "cpu",
>  };
>  
> -static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
> +static struct dsa_platform_data __initdata rd88f6183ap_ge_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &rd88f6183ap_ge_switch_chip_data,
>  };
> @@ -89,8 +89,7 @@ static void __init rd88f6183ap_ge_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&rd88f6183ap_ge_eth_data);
> -	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
> -				gpio_to_irq(3));
> +	orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data);
>  	spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
>  				ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
>  	orion5x_spi_init();
> diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
> index 4e1e5c8f6111..4dbcdbe1de7c 100644
> --- a/arch/arm/mach-orion5x/wnr854t-setup.c
> +++ b/arch/arm/mach-orion5x/wnr854t-setup.c
> @@ -106,7 +106,7 @@ static struct dsa_chip_data wnr854t_switch_chip_data = {
>  	.port_names[7] = "lan2",
>  };
>  
> -static struct dsa_platform_data wnr854t_switch_plat_data = {
> +static struct dsa_platform_data __initdata wnr854t_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &wnr854t_switch_chip_data,
>  };
> @@ -124,7 +124,7 @@ static void __init wnr854t_init(void)
>  	 * Configure peripherals.
>  	 */
>  	orion5x_eth_init(&wnr854t_eth_data);
> -	orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
> +	orion5x_eth_switch_init(&wnr854t_switch_plat_data);
>  	orion5x_uart0_init();
>  
>  	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
> diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
> index 61e9027ef224..a6a8c4648d74 100644
> --- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
> +++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
> @@ -191,7 +191,7 @@ static struct dsa_chip_data wrt350n_v2_switch_chip_data = {
>  	.port_names[7]	= "lan4",
>  };
>  
> -static struct dsa_platform_data wrt350n_v2_switch_plat_data = {
> +static struct dsa_platform_data __initdata wrt350n_v2_switch_plat_data = {
>  	.nr_chips	= 1,
>  	.chip		= &wrt350n_v2_switch_chip_data,
>  };
> @@ -210,7 +210,7 @@ static void __init wrt350n_v2_init(void)
>  	 */
>  	orion5x_ehci0_init();
>  	orion5x_eth_init(&wrt350n_v2_eth_data);
> -	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
> +	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data);
>  	orion5x_uart0_init();
>  
>  	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
> 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,
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 4/4] ARM: orion5x: remove extraneous NO_IRQ
  2016-09-06 14:06   ` Arnd Bergmann
@ 2016-09-14 14:38     ` Gregory CLEMENT
  -1 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:38 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	linux-arm-kernel, Russell King, linux-kernel

Hi Arnd,
 
 On mar., sept. 06 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> rd88f6183ap-ge passes NO_IRQ as the interrupt line for its m25p80
> NOR flash. However, this device never uses an interrupt and the
> driver doesn't care, so we can simply remove the deprecated constant
> here.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied on mvebu/soc with Reviewed-by tag from Andrew Lunn

Thanks,

Gregory

> ---
>  arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> index 4bf80dd5478c..8ffaead76771 100644
> --- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> @@ -71,7 +71,6 @@ static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
>  	{
>  		.modalias	= "m25p80",
>  		.platform_data	= &rd88f6183ap_ge_spi_slave_data,
> -		.irq		= NO_IRQ,
>  		.max_speed_hz	= 20000000,
>  		.bus_num	= 0,
>  		.chip_select	= 0,
> -- 
> 2.9.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH 4/4] ARM: orion5x: remove extraneous NO_IRQ
@ 2016-09-14 14:38     ` Gregory CLEMENT
  0 siblings, 0 replies; 24+ messages in thread
From: Gregory CLEMENT @ 2016-09-14 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,
 
 On mar., sept. 06 2016, Arnd Bergmann <arnd@arndb.de> wrote:

> rd88f6183ap-ge passes NO_IRQ as the interrupt line for its m25p80
> NOR flash. However, this device never uses an interrupt and the
> driver doesn't care, so we can simply remove the deprecated constant
> here.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied on mvebu/soc with Reviewed-by tag from Andrew Lunn

Thanks,

Gregory

> ---
>  arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> index 4bf80dd5478c..8ffaead76771 100644
> --- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> +++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
> @@ -71,7 +71,6 @@ static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
>  	{
>  		.modalias	= "m25p80",
>  		.platform_data	= &rd88f6183ap_ge_spi_slave_data,
> -		.irq		= NO_IRQ,
>  		.max_speed_hz	= 20000000,
>  		.bus_num	= 0,
>  		.chip_select	= 0,
> -- 
> 2.9.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2016-09-14 14:38 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 14:06 [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation Arnd Bergmann
2016-09-06 14:06 ` Arnd Bergmann
2016-09-06 14:06 ` [PATCH 2/4] ARM: mvebu/orion: remove NO_IRQ check from device init Arnd Bergmann
2016-09-06 14:06   ` Arnd Bergmann
2016-09-14 14:37   ` Gregory CLEMENT
2016-09-14 14:37     ` Gregory CLEMENT
2016-09-06 14:06 ` [PATCH 3/4] ARM: orion5x: avoid NO_IRQ in orion_ge00_switch_init Arnd Bergmann
2016-09-06 14:06   ` Arnd Bergmann
2016-09-07  2:03   ` Andrew Lunn
2016-09-07  2:03     ` Andrew Lunn
2016-09-08 15:20     ` Arnd Bergmann
2016-09-08 15:20       ` Arnd Bergmann
2016-09-14 14:37       ` Gregory CLEMENT
2016-09-14 14:37         ` Gregory CLEMENT
2016-09-06 14:06 ` [PATCH 4/4] ARM: orion5x: remove extraneous NO_IRQ Arnd Bergmann
2016-09-06 14:06   ` Arnd Bergmann
2016-09-07  1:49   ` Andrew Lunn
2016-09-07  1:49     ` Andrew Lunn
2016-09-14 14:38   ` Gregory CLEMENT
2016-09-14 14:38     ` Gregory CLEMENT
2016-09-07  1:30 ` [PATCH 1/4] ARM: mv78xx0: simplify ethernet device creation Andrew Lunn
2016-09-07  1:30   ` Andrew Lunn
2016-09-14 14:37 ` Gregory CLEMENT
2016-09-14 14:37   ` Gregory CLEMENT

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.