]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
net: macb: Fix gpio for phy reset
authorHarini Katakam <harini.katakam@xilinx.com>
Tue, 30 May 2017 07:15:06 +0000 (12:45 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 20 Jun 2017 12:13:42 +0000 (14:13 +0200)
The flags, when requesting gpio for phy reset, should have direction
reflected in bit 0 (as out) and active low/high reflected in bit 1.
Currently these flags are wrong in the driver. Correct this to use
the GPIOF_OUT_INIT_* definitions already available.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/cadence/macb.c

index 09fab879f6365dc62a1b66a0b0a905c2f558af9d..420fcab012226354daa5f2ffc72b92e7ddc9e876 100644 (file)
@@ -2937,7 +2937,8 @@ static void macb_reset_phy(struct platform_device *pdev)
                return;
 
        err = devm_gpio_request_one(&pdev->dev, phy_reset,
-                                   (!active_low | GPIOF_DIR_OUT), "phy-reset");
+                                   active_low ? GPIOF_OUT_INIT_LOW :
+                                   GPIOF_OUT_INIT_HIGH, "phy-reset");
        if (err) {
                dev_err(&pdev->dev, "failed to get phy-reset-gpio: %d\n", err);
                return;