net: fec: use managed function devm_gpio_request_one
authorShawn Guo <shawn.guo@linaro.org>
Wed, 27 Jun 2012 03:45:22 +0000 (03:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Jun 2012 04:22:06 +0000 (21:22 -0700)
Using gpio_request_one will require the probe fail-out call gpio_free,
which is missing currently.  Change to use devm_gpio_request_one to
fix the problem.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec.c

index 4dce9e3ac83af02dd682ce8921cecf49dfecac73..f174070646f507df6f34e90042cf98836eb21759 100644 (file)
@@ -1513,7 +1513,8 @@ static void __devinit fec_reset_phy(struct platform_device *pdev)
                return;
 
        phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
-       err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset");
+       err = devm_gpio_request_one(&pdev->dev, phy_reset,
+                                   GPIOF_OUT_INIT_LOW, "phy-reset");
        if (err) {
                pr_debug("FEC: failed to get gpio phy-reset: %d\n", err);
                return;