]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: phylink: Handle NULL fwnode_handle
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 14 Dec 2017 23:57:58 +0000 (15:57 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Dec 2017 18:50:49 +0000 (13:50 -0500)
commit6592dd69883a0c6b4f5e20d4e3dd576c076e43c6
tree79afc628f826cb760d3affcf2f208d0a4df22eed
parent6174922f4dffe9404cbaa90ec568fd4a2a608414
net: phy: phylink: Handle NULL fwnode_handle

Unlike the various of_* routines to fetch properties, fwnode_* routines can
have an early check against a NULL fwnode_handle reference which makes them
return -EINVAL (see fwnode_call_int_op), thus making it virtually impossible to
differentiate what type of error is going on.

Have an early check in phylink_register_sfp() so we can keep proceeding with
the initialization, there is not much we can do without a valid fwnode_handle
except return early and treat this similarly to -ENOENT.

Fixes: 8a6ba033ac22 ("phylink: convert to fwnode")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c