Changeset 28981


Ignore:
Timestamp:
2011-11-12T13:09:42+01:00 (6 years ago)
Author:
juhosg
Message:

ar71xx: pass netdev and miidev pointer to ar71xx_add_device_dsa

Location:
trunk/target/linux/ar71xx/files/arch/mips/ar71xx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.c

    r18943 r28981  
    2323}; 
    2424 
    25 void __init ar71xx_add_device_dsa(unsigned int id, 
     25void __init ar71xx_add_device_dsa(struct device *netdev, 
     26                                  struct device *miidev, 
    2627                                  struct dsa_platform_data *d) 
    2728{ 
    2829        int i; 
    2930 
    30         switch (id) { 
    31         case 0: 
    32                 d->netdev = &ar71xx_eth0_device.dev; 
    33                 break; 
    34         case 1: 
    35                 d->netdev = &ar71xx_eth1_device.dev; 
    36                 break; 
    37         default: 
    38                 printk(KERN_ERR 
    39                         "ar71xx: invalid ethernet id %d for DSA switch\n", 
    40                         id); 
    41                 return; 
    42         } 
    43  
     31        d->netdev = netdev; 
    4432        for (i = 0; i < d->nr_chips; i++) 
    45                 d->chip[i].mii_bus = &ar71xx_mdio_device.dev; 
     33                d->chip[i].mii_bus = miidev; 
    4634 
    4735        ar71xx_dsa_switch_device.dev.platform_data = d; 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/dev-dsa.h

    r18943 r28981  
    1515#include <net/dsa.h> 
    1616 
    17 void ar71xx_add_device_dsa(unsigned int id, 
     17void ar71xx_add_device_dsa(struct device *netdev, 
     18                           struct device *miidev, 
    1819                           struct dsa_platform_data *d) __init; 
    1920 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr841n.c

    r28701 r28981  
    1111#include <linux/mtd/mtd.h> 
    1212#include <linux/mtd/partitions.h> 
     13#include <linux/platform_device.h> 
    1314 
    1415#include <asm/mach-ar71xx/ar71xx.h> 
     
    126127 
    127128        ar71xx_add_device_eth(0); 
    128  
    129         ar71xx_add_device_dsa(0, &tl_wr841n_v1_dsa_data); 
     129        ar71xx_add_device_dsa(&ar71xx_eth0_device.dev, &ar71xx_mdio_device.dev, 
     130                              &tl_wr841n_v1_dsa_data); 
    130131 
    131132        ar71xx_add_device_m25p80(&tl_wr841n_v1_flash_data); 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c

    r28701 r28981  
    1111#include <linux/mtd/mtd.h> 
    1212#include <linux/mtd/partitions.h> 
     13#include <linux/platform_device.h> 
    1314 
    1415#include <asm/mach-ar71xx/ar71xx.h> 
     
    131132 
    132133        ar71xx_add_device_eth(0); 
    133         ar71xx_add_device_dsa(0, &tl_wr941nd_dsa_data); 
     134        ar71xx_add_device_dsa(&ar71xx_eth0_device.dev, &ar71xx_mdio_device.dev, 
     135                              &tl_wr941nd_dsa_data); 
    134136 
    135137        ar71xx_add_device_m25p80(&tl_wr941nd_flash_data); 
Note: See TracChangeset for help on using the changeset viewer.