rtl8366_smi: move variable initialization out from the loop
[openwrt.git] / target / linux / ar71xx / files / drivers / net / phy / rtl8366_smi.c
index b9158d6..6e890b4 100644 (file)
@@ -941,12 +941,12 @@ static int rtl8366s_reset_vlan(struct rtl8366_smi *smi)
        struct rtl8366s_vlanconfig vlanmc;
 
        /* clear 16 VLAN member configuration */
+       vlanmc.vid = 0;
+       vlanmc.priority = 0;
+       vlanmc.member = 0;
+       vlanmc.untag = 0;
+       vlanmc.fid = 0;
        for (i = 0; i < RTL8366_NUM_VLANS; i++) {
-               vlanmc.vid = 0;
-               vlanmc.priority = 0;
-               vlanmc.member = 0;
-               vlanmc.untag = 0;
-               vlanmc.fid = 0;
                if (rtl8366s_set_vlan_member_config(smi, i, &vlanmc) != 0)
                        return -EIO;
        }
@@ -1498,7 +1498,8 @@ static int rtl8366_get_ports(struct switch_dev *dev,
                        continue;
 
                port->id = i;
-               port->flags = vlanmc.untag ? 0 : BIT(SWITCH_PORT_FLAG_TAGGED);
+               port->flags = (vlanmc.untag & BIT(i)) ?
+                                       0 : BIT(SWITCH_PORT_FLAG_TAGGED);
                val->len++;
                port++;
        }
This page took 0.022525 seconds and 4 git commands to generate.