ethernet: fix reboot error
authorZhuo Wang <zhuo.wang@amlogic.com>
Fri, 15 Jun 2018 06:40:51 +0000 (14:40 +0800)
committerZhuo Wang <zhuo.wang@amlogic.com>
Fri, 15 Jun 2018 06:44:16 +0000 (23:44 -0700)
PD#164611: fix error not support powerlow

Change-Id: I9d65b25bebcfb7afccc590629c7865ed490440de
Signed-off-by: Zhuo Wang <zhuo.wang@amlogic.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c

index a854e6c65b60d6878c407509c1cf8e51ad8b245a..6645b49f0e63068eb580b97dff541493e2248bab 100644 (file)
@@ -428,7 +428,11 @@ static int meson6_dwmac_suspend(struct device *dev)
                pin_ctrl = devm_pinctrl_get(dev);
                turnoff_tes = pinctrl_lookup_state
                                        (pin_ctrl, "internal_gpio_pins");
-               pinctrl_select_state(pin_ctrl, turnoff_tes);
+               if (IS_ERR_OR_NULL(turnoff_tes))
+                       pr_info("Not support gpio low\n");
+               else
+                       pinctrl_select_state(pin_ctrl, turnoff_tes);
+
                devm_pinctrl_put(pin_ctrl);
                pin_ctrl = NULL;
                dwmac_meson_disable_analog(dev);
@@ -472,7 +476,12 @@ void meson6_dwmac_shutdown(struct platform_device *pdev)
                pin_ctrl = devm_pinctrl_get(&pdev->dev);
                turnoff_tes = pinctrl_lookup_state
                                        (pin_ctrl, "internal_gpio_pins");
-               pinctrl_select_state(pin_ctrl, turnoff_tes);
+               if (IS_ERR_OR_NULL(turnoff_tes))
+                       pr_info("Not support gpio low\n");
+               else
+                       pinctrl_select_state(pin_ctrl, turnoff_tes);
+
+               //pinctrl_select_state(pin_ctrl, turnoff_tes);
                devm_pinctrl_put(pin_ctrl);
                pin_ctrl = NULL;
                dwmac_meson_disable_analog(&pdev->dev);