Changeset 35514


Ignore:
Timestamp:
2013-02-07T16:18:36+01:00 (5 years ago)
Author:
juhosg
Message:

generic: ar8216: use inline function to convert swdev to ar8216

Signed-off-by: Gabor Juhos <juhosg@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/files/drivers/net/phy/ar8216.c

    r35513 r35514  
    199199}; 
    200200 
    201 #define to_ar8216(_dev) container_of(_dev, struct ar8216_priv, dev) 
     201static inline struct ar8216_priv * 
     202swdev_to_ar8216(struct switch_dev *swdev) 
     203{ 
     204        return container_of(swdev, struct ar8216_priv, dev); 
     205} 
    202206 
    203207static inline bool ar8xxx_has_gige(struct ar8216_priv *priv) 
     
    12601264                   struct switch_val *val) 
    12611265{ 
    1262         struct ar8216_priv *priv = to_ar8216(dev); 
     1266        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    12631267        priv->vlan = !!val->value.i; 
    12641268        return 0; 
     
    12691273                   struct switch_val *val) 
    12701274{ 
    1271         struct ar8216_priv *priv = to_ar8216(dev); 
     1275        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    12721276        val->value.i = priv->vlan; 
    12731277        return 0; 
     
    12781282ar8216_sw_set_pvid(struct switch_dev *dev, int port, int vlan) 
    12791283{ 
    1280         struct ar8216_priv *priv = to_ar8216(dev); 
     1284        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    12811285 
    12821286        /* make sure no invalid PVIDs get set */ 
     
    12921296ar8216_sw_get_pvid(struct switch_dev *dev, int port, int *vlan) 
    12931297{ 
    1294         struct ar8216_priv *priv = to_ar8216(dev); 
     1298        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    12951299        *vlan = priv->pvid[port]; 
    12961300        return 0; 
     
    13011305                  struct switch_val *val) 
    13021306{ 
    1303         struct ar8216_priv *priv = to_ar8216(dev); 
     1307        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    13041308        priv->vlan_id[val->port_vlan] = val->value.i; 
    13051309        return 0; 
     
    13101314                  struct switch_val *val) 
    13111315{ 
    1312         struct ar8216_priv *priv = to_ar8216(dev); 
     1316        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    13131317        val->value.i = priv->vlan_id[val->port_vlan]; 
    13141318        return 0; 
     
    13191323                        struct switch_port_link *link) 
    13201324{ 
    1321         struct ar8216_priv *priv = to_ar8216(dev); 
     1325        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    13221326 
    13231327        ar8216_read_port_link(priv, port, link); 
     
    13281332ar8216_sw_get_ports(struct switch_dev *dev, struct switch_val *val) 
    13291333{ 
    1330         struct ar8216_priv *priv = to_ar8216(dev); 
     1334        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    13311335        u8 ports = priv->vlan_table[val->port_vlan]; 
    13321336        int i; 
     
    13521356ar8216_sw_set_ports(struct switch_dev *dev, struct switch_val *val) 
    13531357{ 
    1354         struct ar8216_priv *priv = to_ar8216(dev); 
     1358        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    13551359        u8 *vt = &priv->vlan_table[val->port_vlan]; 
    13561360        int i, j; 
     
    13831387ar8216_sw_hw_apply(struct switch_dev *dev) 
    13841388{ 
    1385         struct ar8216_priv *priv = to_ar8216(dev); 
     1389        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    13861390        u8 portmask[AR8X16_MAX_PORTS]; 
    13871391        int i, j; 
     
    14501454ar8216_sw_reset_switch(struct switch_dev *dev) 
    14511455{ 
    1452         struct ar8216_priv *priv = to_ar8216(dev); 
     1456        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    14531457        int i; 
    14541458 
     
    14751479                         struct switch_val *val) 
    14761480{ 
    1477         struct ar8216_priv *priv = to_ar8216(dev); 
     1481        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    14781482        unsigned int len; 
    14791483        int ret; 
     
    15031507                             struct switch_val *val) 
    15041508{ 
    1505         struct ar8216_priv *priv = to_ar8216(dev); 
     1509        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    15061510        int port; 
    15071511        int ret; 
     
    15331537                       struct switch_val *val) 
    15341538{ 
    1535         struct ar8216_priv *priv = to_ar8216(dev); 
     1539        struct ar8216_priv *priv = swdev_to_ar8216(dev); 
    15361540        const struct ar8xxx_chip *chip = priv->chip; 
    15371541        u64 *mib_stats; 
Note: See TracChangeset for help on using the changeset viewer.