From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: [PATCH net-next] net: dsa: mv88e6xxx: Be explicit about DT or pdata Date: Thu, 31 May 2018 00:15:42 +0200 Message-ID: <1527718542-22658-1-git-send-email-andrew@lunn.ch> Cc: Vivien Didelot , Florian Fainelli , dan.carpenter@oracle.com, netdev , Andrew Lunn To: David Miller Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:50153 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932447AbeE3WQS (ORCPT ); Wed, 30 May 2018 18:16:18 -0400 Sender: netdev-owner@vger.kernel.org List-ID: 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 --- drivers/net/dsa/mv88e6xxx/chip.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.17.0