]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net: dsa: mv88e6xxx: Be explicit about DT or pdata
authorAndrew Lunn <andrew@lunn.ch>
Wed, 30 May 2018 22:15:42 +0000 (00:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 May 2018 19:54:32 +0000 (15:54 -0400)
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>
drivers/net/dsa/mv88e6xxx/chip.c

index 12df00f593b775669c7fc77a8869da6b41d012fb..437cd6eb4faa39338108b73b43abaa89a559607c 100644 (file)
@@ -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);