.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;
#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 */
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/platform_device.h>
#include <asm/mach-ar71xx/ar71xx.h>
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);
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/platform_device.h>
#include <asm/mach-ar71xx/ar71xx.h>
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);