diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-08-04 00:43:40 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-08-04 00:43:40 +0000 |
commit | bd6324190fb4784a51ae70ecd0b1e0c606213702 (patch) | |
tree | fb07f597da35c8b342abb43998198b47d8f3f34d /target/linux/generic/files/drivers/net/phy/rtl8366rb.c | |
parent | 86b209211e125479e547b18163b01dc99cfc400d (diff) | |
download | upstream-bd6324190fb4784a51ae70ecd0b1e0c606213702.tar.gz upstream-bd6324190fb4784a51ae70ecd0b1e0c606213702.tar.bz2 upstream-bd6324190fb4784a51ae70ecd0b1e0c606213702.zip |
swconfig: cleanup of kernel drivers and interface - add some comments to a few data structures - add a switch_dev_ops data structure for attributes and callback to replace the stupid template memcpy - get rid of the switch_dev.priv pointer - using container_of() is better
SVN-Revision: 22476
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/rtl8366rb.c')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/rtl8366rb.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c index 79533263bb..659445a64c 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c @@ -849,12 +849,7 @@ static struct switch_attr rtl8366rb_vlan[] = { }, }; -/* template */ -static struct switch_dev rtl8366_switch_dev = { - .name = "RTL8366S", - .cpu_port = RTL8366RB_PORT_NUM_CPU, - .ports = RTL8366RB_NUM_PORTS, - .vlans = RTL8366RB_NUM_VLANS, +static const struct switch_dev_ops rtl8366_ops = { .attr_global = { .attr = rtl8366rb_globals, .n_attr = ARRAY_SIZE(rtl8366rb_globals), @@ -880,8 +875,11 @@ static int rtl8366rb_switch_init(struct rtl8366_smi *smi) struct switch_dev *dev = &smi->sw_dev; int err; - memcpy(dev, &rtl8366_switch_dev, sizeof(struct switch_dev)); - dev->priv = smi; + dev->name = "RTL8366RB"; + dev->cpu_port = RTL8366RB_PORT_NUM_CPU; + dev->ports = RTL8366RB_NUM_PORTS; + dev->vlans = RTL8366RB_NUM_VLANS; + dev->ops = &rtl8366_ops; dev->devname = dev_name(smi->parent); err = register_switch(dev, NULL); |