rtl8366_smi: fix error checking in rtl8366s_set_vlan_4k_entry
authorGabor Juhos <juhosg@openwrt.org>
Wed, 20 Jan 2010 09:30:32 +0000 (09:30 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Wed, 20 Jan 2010 09:30:32 +0000 (09:30 +0000)
SVN-Revision: 19242

target/linux/ar71xx/files/drivers/net/phy/rtl8366_smi.c

index 46069067e782a10055121e6f1c1c2aa3087edd64..1043b3d44e135e27f941d9f3b8bf3292521cc8d6 100644 (file)
@@ -671,16 +671,16 @@ static int rtl8366s_set_vlan_4k_entry(struct rtl8366_smi *smi,
 
        data = *tableaddr;
 
-       rtl8366_smi_write_reg(smi, RTL8366S_VLAN_TABLE_WRITE_BASE + 1, data);
-
+       err = rtl8366_smi_write_reg(smi, RTL8366S_VLAN_TABLE_WRITE_BASE + 1,
+                                   data);
+       if (err)
+               return err;
 
        /* write table access control word */
        err = rtl8366_smi_write_reg(smi, RTL8366S_TABLE_ACCESS_CTRL_REG,
                                    RTL8366S_TABLE_VLAN_WRITE_CTRL);
-       if (err)
-               return err;
 
-       return 0;
+       return err;
 }
 
 static int rtl8366s_get_vlan_member_config(struct rtl8366_smi *smi, u32 index,