net: dsa: Split platform data to header file
Subsystems (8)
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
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
@@ -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
Andrew Lunn
maintainerinclude/net/dsa.h line 26
Quoted 11 lines
include/net/dsa.h +1
-0@@ -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
Quoted 14 lines · Andrew Lunn
include/net/dsa.h line 26
Quoted 11 lines
include/net/dsa.h +1
-0@@ -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
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@@ -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.candlegacy.cinclude 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
Andrew Lunn
maintainerQuoted 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@@ -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.candlegacy.cinclude 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_SWITCHESinnet/dsa.hand splitting that define away could be a bit tedious since it is used bydsa_platform_datawhich was exposed before.
Hi Florian
O.K, so lets keep the patchset as it is.
Thanks
Andrew
PATCH 2/3 ARM: orion5x: Include platform_data/dsa.h
In reply to Florian FainelliNow 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 3/3 net: dsa: Include platform_data header file
In reply to Florian Fainellib53 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
@@ -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
@@ -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
Quoted 6 lines · Florian Fainelli
Hi all,
This patch series decouples the DSA platform data structures from
net/dsa.hwhich 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,
Quoted 11 lines · Florian Fainelli
Hi all,
This patch series decouples the DSA platform data structures from
net/dsa.hwhich 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
David Miller
maintainerFrom: 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.hwhich 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.