All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: at803x: don't depend on GPIOLIB
@ 2016-03-16 17:25 Sebastian Frias
  2016-03-18 12:12 ` Mason
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Sebastian Frias @ 2016-03-16 17:25 UTC (permalink / raw)
  To: Uwe Kleine-König, David S. Miller, netdev; +Cc: lkml, mason

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

^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2016-03-24 13:41 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 17:25 [PATCH] net: phy: at803x: don't depend on GPIOLIB Sebastian Frias
2016-03-18 12:12 ` Mason
2016-03-18 12:54 ` Uwe Kleine-König
2016-03-18 12:54   ` Uwe Kleine-König
2016-03-18 15:56   ` Sebastian Frias
2016-03-18 19:12     ` Uwe Kleine-König
2016-03-18 19:31       ` Mason
2016-03-18 20:11         ` Uwe Kleine-König
2016-03-18 20:44           ` Mason
2016-03-19 10:01             ` Måns Rullgård
2016-03-21 12:48       ` Sebastian Frias
2016-03-21 12:48         ` Sebastian Frias
2016-03-21 13:54         ` Uwe Kleine-König
2016-03-21 15:36           ` Sebastian Frias
2016-03-21 20:12             ` Uwe Kleine-König
2016-03-22 14:34               ` Sebastian Frias
2016-03-22 19:42                 ` Uwe Kleine-König
2016-03-23 10:12                   ` Sebastian Frias
2016-03-23 10:49                     ` [PATCH] net: phy: at803x: Request 'reset' GPIO only for AT8030 PHY Sebastian Frias
2016-03-23 17:40                       ` David Miller
2016-03-23 19:42                       ` Sergei Shtylyov
2016-03-24  9:55                         ` Sebastian Frias
2016-03-24 10:10                           ` Sebastian Frias
2016-03-24 13:40                             ` Sergei Shtylyov
2016-03-23 10:17                   ` [PATCH] net: phy: at803x: don't depend on GPIOLIB Mason
2016-03-23 10:39                     ` Sergei Shtylyov
2016-03-23 10:55                       ` Sebastian Frias
2016-03-22 14:34     ` Sebastian Frias
2016-03-21 20:15 ` Sergei Shtylyov
2016-03-21 20:41   ` Uwe Kleine-König
2016-03-21 21:56     ` Sergei Shtylyov
2016-03-22 14:53     ` Sebastian Frias
2016-03-22 14:39   ` Sebastian Frias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.