瀏覽代碼

fec: Revert "fec: Do not assume that PHY reset is active low"

In order to keep DT compatibility we need to revert this, otherwise the original
dts files will no longer work with this driver change.

This reverts commit 7a399e3a2e05bc580a78ea72371b3896827f72e1.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fabio Estevam 11 年之前
父節點
當前提交
7d30622dbe
共有 1 個文件被更改,包括 4 次插入10 次删除
  1. 4 10
      drivers/net/ethernet/freescale/fec_main.c

+ 4 - 10
drivers/net/ethernet/freescale/fec_main.c

@@ -2049,8 +2049,6 @@ static void fec_reset_phy(struct platform_device *pdev)
 	int err, phy_reset;
 	int msec = 1;
 	struct device_node *np = pdev->dev.of_node;
-	enum of_gpio_flags flags;
-	bool port;
 
 	if (!np)
 		return;
@@ -2060,22 +2058,18 @@ static void fec_reset_phy(struct platform_device *pdev)
 	if (msec > 1000)
 		msec = 1;
 
-	phy_reset = of_get_named_gpio_flags(np, "phy-reset-gpios", 0, &flags);
+	phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
 	if (!gpio_is_valid(phy_reset))
 		return;
 
-	if (flags & OF_GPIO_ACTIVE_LOW)
-		port = GPIOF_OUT_INIT_LOW;
-	else
-		port = GPIOF_OUT_INIT_HIGH;
-
-	err = devm_gpio_request_one(&pdev->dev, phy_reset, port, "phy-reset");
+	err = devm_gpio_request_one(&pdev->dev, phy_reset,
+				    GPIOF_OUT_INIT_LOW, "phy-reset");
 	if (err) {
 		dev_err(&pdev->dev, "failed to get phy-reset-gpios: %d\n", err);
 		return;
 	}
 	msleep(msec);
-	gpio_set_value(phy_reset, !port);
+	gpio_set_value(phy_reset, 1);
 }
 #else /* CONFIG_OF */
 static void fec_reset_phy(struct platform_device *pdev)