Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359207 > unrolled thread

[PATCH] net: phy: at803x: don't depend on GPIOLIB

Started bySebastian Frias <sf84@laposte.net>
First post2016-03-16 19:00 +0100
Last post2016-03-16 19:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: phy: at803x: don't depend on GPIOLIB Sebastian Frias <sf84@laposte.net> - 2016-03-16 19:00 +0100

#1359207 — [PATCH] net: phy: at803x: don't depend on GPIOLIB

FromSebastian Frias <sf84@laposte.net>
Date2016-03-16 19:00 +0100
Subject[PATCH] net: phy: at803x: don't depend on GPIOLIB
Message-ID<rdnTI-3JO-25@gated-at.bofh.it>
Commit 687908c2b649 ("net: phy: at803x: simplify using
devm_gpiod_get_optional and its 4th argument") introduced a dependency
on GPIOLIB that was not there before.

This commit removes such dependency by checking the return code and
comparing it against ENOSYS which is returned when GPIOLIB is not
selected.

Fixes: 687908c2b649 ("net: phy: at803x: simplify using
devm_gpiod_get_optional and its 4th argument")

Signed-off-by: Sebastian Frias <sf84@laposte.net>
---
 drivers/net/phy/at803x.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 2174ec9..88b7ff3 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -252,7 +252,9 @@ static int at803x_probe(struct phy_device *phydev)
 		return -ENOMEM;

 	gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
-	if (IS_ERR(gpiod_reset))
+	if (PTR_ERR(gpiod_reset) == -ENOSYS)
+		gpiod_reset = NULL;
+	else if (IS_ERR(gpiod_reset))
 		return PTR_ERR(gpiod_reset);

 	priv->gpiod_reset = gpiod_reset;
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web