diff mbox series

[net-next] net: dsa: mv88e6xxx: Be explicit about DT or pdata

Message ID 1527718542-22658-1-git-send-email-andrew@lunn.ch
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net-next] net: dsa: mv88e6xxx: Be explicit about DT or pdata | expand

Commit Message

Andrew Lunn May 30, 2018, 10:15 p.m. UTC
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>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Vivien Didelot May 31, 2018, 1:51 p.m. UTC | #1
Andrew Lunn <andrew@lunn.ch> writes:

> 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>
Florian Fainelli May 31, 2018, 2:12 p.m. UTC | #2
On 05/30/2018 03:15 PM, Andrew Lunn wrote:
> 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: Florian Fainelli <f.fainelli@gmail.com>
David Miller May 31, 2018, 7:54 p.m. UTC | #3
From: Andrew Lunn <andrew@lunn.ch>
Date: Thu, 31 May 2018 00:15:42 +0200

> 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>

Applied, thanks.
diff mbox series

Patch

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);