diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-11-12 12:09:42 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2011-11-12 12:09:42 +0000 |
commit | b07b687aecfa2a2568e5ac9038ef33d5ed6ce1ab (patch) | |
tree | 4d87ca6b70a2ecc7e3bb10f9d6f8a1666bd9339e /target/linux/ar71xx | |
parent | a9216bb76e49254eafb93d3a5fa1e24ab3589b3c (diff) | |
download | mtk-20170518-b07b687aecfa2a2568e5ac9038ef33d5ed6ce1ab.zip mtk-20170518-b07b687aecfa2a2568e5ac9038ef33d5ed6ce1ab.tar.gz mtk-20170518-b07b687aecfa2a2568e5ac9038ef33d5ed6ce1ab.tar.bz2 |
ar71xx: pass netdev and miidev pointer to ar71xx_add_device_dsa
SVN-Revision: 28981
Diffstat (limited to 'target/linux/ar71xx')
4 files changed, 12 insertions, 20 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.c index c2877f2..8b8fcfa 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.c @@ -22,27 +22,15 @@ static struct platform_device ar71xx_dsa_switch_device = { .id = 0, }; -void __init ar71xx_add_device_dsa(unsigned int id, +void __init ar71xx_add_device_dsa(struct device *netdev, + struct device *miidev, struct dsa_platform_data *d) { int i; - switch (id) { - case 0: - d->netdev = &ar71xx_eth0_device.dev; - break; - case 1: - d->netdev = &ar71xx_eth1_device.dev; - break; - default: - printk(KERN_ERR - "ar71xx: invalid ethernet id %d for DSA switch\n", - id); - return; - } - + d->netdev = netdev; for (i = 0; i < d->nr_chips; i++) - d->chip[i].mii_bus = &ar71xx_mdio_device.dev; + d->chip[i].mii_bus = miidev; ar71xx_dsa_switch_device.dev.platform_data = d; diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.h b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.h index 2b11882..25b9881 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.h +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.h @@ -14,7 +14,8 @@ #include <net/dsa.h> -void ar71xx_add_device_dsa(unsigned int id, +void ar71xx_add_device_dsa(struct device *netdev, + struct device *miidev, struct dsa_platform_data *d) __init; #endif /* _AR71XX_DEV_DSA_H */ diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr841n.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr841n.c index e34a8fc..4646ada 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr841n.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr841n.c @@ -10,6 +10,7 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> +#include <linux/platform_device.h> #include <asm/mach-ar71xx/ar71xx.h> @@ -125,8 +126,8 @@ static void __init tl_wr841n_v1_setup(void) ar71xx_eth0_data.duplex = DUPLEX_FULL; ar71xx_add_device_eth(0); - - ar71xx_add_device_dsa(0, &tl_wr841n_v1_dsa_data); + ar71xx_add_device_dsa(&ar71xx_eth0_device.dev, &ar71xx_mdio_device.dev, + &tl_wr841n_v1_dsa_data); ar71xx_add_device_m25p80(&tl_wr841n_v1_flash_data); diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c index 8ca611d..2a4b453 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c @@ -10,6 +10,7 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> +#include <linux/platform_device.h> #include <asm/mach-ar71xx/ar71xx.h> @@ -130,7 +131,8 @@ static void __init tl_wr941nd_setup(void) ar71xx_eth0_data.duplex = DUPLEX_FULL; ar71xx_add_device_eth(0); - ar71xx_add_device_dsa(0, &tl_wr941nd_dsa_data); + ar71xx_add_device_dsa(&ar71xx_eth0_device.dev, &ar71xx_mdio_device.dev, + &tl_wr941nd_dsa_data); ar71xx_add_device_m25p80(&tl_wr941nd_flash_data); |