ethernet: fix bug for get mc_val_external_phy from dts. [1/1]
authorQi Duan <qi.duan@amlogic.com>
Tue, 8 Aug 2017 11:49:57 +0000 (19:49 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 10 Aug 2017 11:22:27 +0000 (04:22 -0700)
PD#148981: ethernet: fix bug for get mc_val_external_phy from dts.

Change-Id: I49378493f1bd7eb3fdab385de698aee323319069
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c

index d9bbcef..9236e8e 100644 (file)
@@ -125,8 +125,10 @@ static void __iomem *network_interface_setup(struct platform_device *pdev)
                } else {
                        /* Get mec mode & ting value  set it in cbus2050 */
                        if (of_property_read_u32(np, "mc_val_external_phy",
-                                                &mc_val))
+                                                &mc_val)) {
+                       } else {
                                writel(mc_val, PREG_ETH_REG0);
+                       }
                        if (!of_property_read_u32(np, "cali_val", &cali_val))
                                writel(cali_val, PREG_ETH_REG1);
                        if (res) {