Skip to contentSkip to conversation

net: dsa: Split platform data to header file

PATCH In review Florian Fainelli 4 participants 11 messages Jan 15, 2019 – Jan 17, 2019

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

cover net: dsa: Split platform data to header file

Hi all,

This patch series decouples the DSA platform data structures from net/dsa.h which was getting used for all sorts of DSA related structures.

It would probably make sense for this series to go via David's net-next tree to avoid conflicts on the ARM part, since we cannot obviously include a header that does not yet exist.

No functional changes intended.

Florian Fainelli (3):
net: dsa: Split platform data to header file
ARM: orion5x: Include platform_data/dsa.h
net: dsa: Include platform_data header file

 MAINTAINERS                                  |  1 +
 arch/arm/mach-orion5x/common.c               |  2 +-
 arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c |  2 +-
 arch/arm/mach-orion5x/rd88f5181l-ge-setup.c  |  2 +-
 arch/arm/mach-orion5x/rd88f6183ap-ge-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                 |  2 +-
 include/linux/platform_data/b53.h            |  2 +-
 include/linux/platform_data/dsa.h            | 68 ++++++++++++++++++++
 include/linux/platform_data/mv88e6xxx.h      |  2 +-
 include/net/dsa.h                            | 61 +-----------------
 12 files changed, 79 insertions(+), 69 deletions(-)
 create mode 100644 include/linux/platform_data/dsa.h
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 net: dsa: Split platform data to header file

Instead of having net/dsa.h contain both the internal switch tree/driver structures, split the relevant platform_data parts into include/linux/platform_data/dsa.h and make that header be included by net/dsa.h in order not to break any setup. A subsequent set of patches will update code including net/dsa.h to include only the platform_data header.

---
 MAINTAINERS                       |  1 +
 include/linux/platform_data/dsa.h | 68 +++++++++++++++++++++++++++++++
 include/net/dsa.h                 | 61 +--------------------------
 3 files changed, 70 insertions(+), 60 deletions(-)
 create mode 100644 include/linux/platform_data/dsa.h
MAINTAINERS +1 -0
index 4d04cebb4a71..a592b9992b46 100644
@@ -10576,6 +10576,7 @@ F:	Documentation/devicetree/bindings/net/dsa/
 F:	net/dsa/
 F:	include/net/dsa.h
 F:	include/linux/dsa/
+F:	include/linux/platform_data/dsa.h
 F:	drivers/net/dsa/
 
 NETWORKING [GENERAL]
include/linux/platform_data/dsa.h new file +68 -0

68 lines not on this page · raw message

include/net/dsa.h +1 -60

73 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer
#2 lore raw

include/net/dsa.h line 26

Quoted 11 lines
include/net/dsa.h +1 -0
index b3eefe8e18fd..6178b648d08a 100644
@@ -21,6 +21,7 @@
 #include <linux/ethtool.h>
 #include <linux/net_tstamp.h>
 #include <linux/phy.h>
+#include <linux/platform_data/dsa.h>
 #include <net/devlink.h>
 #include <net/switchdev.h>

Hi Florian

Could there be one more patch at the end which removes this? I think it is here just as an intermediary step?

Thanks
Andrew

#3 lore raw
Quoted 14 lines · Andrew Lunn

include/net/dsa.h line 26

Quoted 11 lines
include/net/dsa.h +1 -0
index b3eefe8e18fd..6178b648d08a 100644
@@ -21,6 +21,7 @@
 #include <linux/ethtool.h>
 #include <linux/net_tstamp.h>
 #include <linux/phy.h>
+#include <linux/platform_data/dsa.h>
 #include <net/devlink.h>
 #include <net/switchdev.h>

Hi Florian

Quoted 2 lines

Could there be one more patch at the end which removes this? I think it is here just as an intermediary step?

Yes, we can have only dsa2.c and legacy.c include that file from there on, I will resubmit with that change, thanks!

Signature · 6 lines
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#4 lore raw
Quoted 15 lines · Florian Fainelli
Quoted 14 lines · Andrew Lunn

include/net/dsa.h line 26

Quoted 11 lines
include/net/dsa.h +1 -0
index b3eefe8e18fd..6178b648d08a 100644
@@ -21,6 +21,7 @@
 #include <linux/ethtool.h>
 #include <linux/net_tstamp.h>
 #include <linux/phy.h>
+#include <linux/platform_data/dsa.h>
 #include <net/devlink.h>
 #include <net/switchdev.h>

Hi Florian

Quoted 5 lines
Quoted 2 lines

Could there be one more patch at the end which removes this? I think it is here just as an intermediary step?

Yes, we can have only dsa2.c and legacy.c include that file from there on, I will resubmit with that change, thanks!

We actually need to keep that include in there, because we use DSA_MAX_SWITCHES in net/dsa.h and splitting that define away could be a bit tedious since it is used by dsa_platform_data which was exposed before.

Another option could be to not expose dsa_platform_data all, only dsa_chip_data which describes a single switch, and then we can have a nice and lean platform_data/dsa.h file that only has a few definitions.

Which route do you prefer?

Signature · 6 lines
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#5 lore raw
Quoted 19 lines · Florian Fainelli
Quoted 18 lines · Florian Fainelli
Quoted 16 lines · Andrew Lunn

include/net/dsa.h line 26

Quoted 11 lines
include/net/dsa.h +1 -0
index b3eefe8e18fd..6178b648d08a 100644
@@ -21,6 +21,7 @@
 #include <linux/ethtool.h>
 #include <linux/net_tstamp.h>
 #include <linux/phy.h>
+#include <linux/platform_data/dsa.h>
 #include <net/devlink.h>
 #include <net/switchdev.h>

Hi Florian

Could there be one more patch at the end which removes this? I think it is here just as an intermediary step?

Quoted 6 lines
Quoted 2 lines

Yes, we can have only dsa2.c and legacy.c include that file from there on, I will resubmit with that change, thanks!

We actually need to keep that include in there, because we use DSA_MAX_SWITCHES in net/dsa.h and splitting that define away could be a bit tedious since it is used by dsa_platform_data which was exposed before.

Hi Florian

O.K, so lets keep the patchset as it is.

Thanks
Andrew

#6 lore raw

PATCH 2/3 ARM: orion5x: Include platform_data/dsa.h

In reply to Florian Fainelli

Now that we have split the DSA platform data structures from the main net/dsa.h header file, include only the relevant header file.

---
 arch/arm/mach-orion5x/common.c               | 2 +-
 arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c | 2 +-
 arch/arm/mach-orion5x/rd88f5181l-ge-setup.c  | 2 +-
 arch/arm/mach-orion5x/rd88f6183ap-ge-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                 | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-orion5x/common.c +1 -1
index 83a7ec4c16d0..c67f92bfa30e 100644
@@ -20,7 +20,7 @@
 #include <linux/delay.h>
 #include <linux/clk-provider.h>
 #include <linux/cpu.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 #include <asm/page.h>
 #include <asm/setup.h>
 #include <asm/system_misc.h>
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c +1 -1
index a3c1336d30c9..c65ab7db36ad 100644
@@ -16,7 +16,7 @@
 #include <linux/mtd/physmap.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/ethtool.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c +1 -1
index 252efe29bd1a..76b8138d9d79 100644
@@ -17,7 +17,7 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/ethtool.h>
 #include <linux/i2c.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c +1 -1
index f4f1dbe1d91d..5f388a1ed1e4 100644
@@ -18,7 +18,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/ethtool.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
arch/arm/mach-orion5x/wnr854t-setup.c +1 -1
index d162d4c7f85d..83589a28a491 100644
@@ -15,7 +15,7 @@
 #include <linux/mtd/physmap.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/ethtool.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
arch/arm/mach-orion5x/wrt350n-v2-setup.c +1 -1
index 9250bb2e429c..cea08d4a2597 100644
@@ -18,7 +18,7 @@
 #include <linux/leds.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
arch/arm/plat-orion/common.c +1 -1
index a2399fd66e97..a6c81ce00f52 100644
@@ -18,7 +18,7 @@
 #include <linux/clkdev.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/mv643xx_i2c.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 #include <linux/platform_data/dma-mv_xor.h>
 #include <linux/platform_data/usb-ehci-orion.h>
 #include <plat/common.h>
Signature · 1 line
2.17.1
#7 lore raw

PATCH 3/3 net: dsa: Include platform_data header file

In reply to Florian Fainelli

b53 and mv88e6xxx support passing platform_data, and now that we have split the platform_data portion from the main net/dsa.h header file, include only the relevant parts.

---
 include/linux/platform_data/b53.h       | 2 +-
 include/linux/platform_data/mv88e6xxx.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/platform_data/b53.h +1 -1
index 8eaef2f2b691..c3b61ead41f2 100644
@@ -20,7 +20,7 @@
 #define __B53_H
 
 #include <linux/kernel.h>
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 
 struct b53_platform_data {
 	/* Must be first such that dsa_register_switch() can access it */
include/linux/platform_data/mv88e6xxx.h +1 -1
index f63af2955ea0..963730b44aea 100644
@@ -2,7 +2,7 @@
 #ifndef __DSA_MV88E6XXX_H
 #define __DSA_MV88E6XXX_H
 
-#include <net/dsa.h>
+#include <linux/platform_data/dsa.h>
 
 struct dsa_mv88e6xxx_pdata {
 	/* Must be first, such that dsa_register_switch() can access this
Signature · 1 line
2.17.1
Acked-by on the v1 series
#8 lore raw
In reply to Florian Fainelli
Quoted 6 lines · Florian Fainelli

Hi all,

This patch series decouples the DSA platform data structures from net/dsa.h which was getting used for all sorts of DSA related structures.

Nice cleanup!

Quoted 3 lines

It would probably make sense for this series to go via David's net-next tree to avoid conflicts on the ARM part, since we cannot obviously include a header that does not yet exist.

Agreed,

maintainer Reviewed-by on the v1 series
#9 lore raw
In reply to Florian Fainelli
Quoted 11 lines · Florian Fainelli

Hi all,

This patch series decouples the DSA platform data structures from net/dsa.h which was getting used for all sorts of DSA related structures.

It would probably make sense for this series to go via David's net-next tree to avoid conflicts on the ARM part, since we cannot obviously include a header that does not yet exist.

No functional changes intended.

Andrew

maintainer
#10 lore raw
In reply to Florian Fainelli

From: Florian Fainelli <[email protected]>
Date: Tue, 15 Jan 2019 15:06:10 -0800

Quoted 9 lines

This patch series decouples the DSA platform data structures from net/dsa.h which was getting used for all sorts of DSA related structures.

It would probably make sense for this series to go via David's net-next tree to avoid conflicts on the ARM part, since we cannot obviously include a header that does not yet exist.

No functional changes intended.

Series applied, thanks Florian.