浏览代码

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>
Andrew Lunn 7 年之前
父节点
当前提交
7bb8c9969d
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/net/dsa/mv88e6xxx/chip.c

+ 3 - 0
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);