Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: fixed_phy: print gpio error only if gpio node is present

It is perfectly ok to not have an gpio attached to the fixed-link node. So
the driver should not throw an error message when the gpio is missing.

Fixes: 5468e82f7034 ("net: phy: fixed-phy: Drop GPIO from fixed_phy_add()")
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hubert Feurstein and committed by
David S. Miller
ab98c008 a20961cc

+4 -2
+4 -2
drivers/net/phy/fixed_phy.c
··· 216 216 if (IS_ERR(gpiod)) { 217 217 if (PTR_ERR(gpiod) == -EPROBE_DEFER) 218 218 return gpiod; 219 - pr_err("error getting GPIO for fixed link %pOF, proceed without\n", 220 - fixed_link_node); 219 + 220 + if (PTR_ERR(gpiod) != -ENOENT) 221 + pr_err("error getting GPIO for fixed link %pOF, proceed without\n", 222 + fixed_link_node); 221 223 gpiod = NULL; 222 224 } 223 225