From: Andrew Lunn Date: Wed, 30 May 2018 22:15:42 +0000 (+0200) Subject: net: dsa: mv88e6xxx: Be explicit about DT or pdata X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7bb8c9969d919517fc379cacebd8fa93704173db;p=openwrt%2Fstaging%2Fblogic.git net: dsa: mv88e6xxx: Be explicit about DT or pdata Make it explicit that either device tree is used or platform data. If neither is available, abort the probe. Reported-by: Dan Carpenter Fixes: 877b7cb0b6f2 ("net: dsa: mv88e6xxx: Add minimal platform_data support") Signed-off-by: Andrew Lunn Reviewed-by: Vivien Didelot Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 12df00f593b7..437cd6eb4faa 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -4389,6 +4389,9 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) int port; int err; + if (!np && !pdata) + return -EINVAL; + if (np) compat_info = of_device_get_match_data(dev);