aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-05-31 00:15:42 +0200
committerDavid S. Miller <davem@davemloft.net>2018-05-31 15:54:32 -0400
commit7bb8c9969d919517fc379cacebd8fa93704173db (patch)
treef403a64be17b48f1bb63ea6badaa96c49d3499ae /drivers/net/dsa
parentnet: ti: cpsw: include gpio/consumer.h (diff)
downloadlinux-dev-7bb8c9969d919517fc379cacebd8fa93704173db.tar.xz
linux-dev-7bb8c9969d919517fc379cacebd8fa93704173db.zip
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 <dan.carpenter@oracle.com> Fixes: 877b7cb0b6f2 ("net: dsa: mv88e6xxx: Add minimal platform_data support") Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c3
1 files changed, 3 insertions, 0 deletions
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);