From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr730114.outbound.protection.outlook.com ([40.107.73.114]:62688 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729984AbeIXUvi (ORCPT ); Mon, 24 Sep 2018 16:51:38 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Baruch Siach , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 34/76] net: mvpp2: initialize port of_node pointer Date: Mon, 24 Sep 2018 14:48:22 +0000 Message-ID: <20180924144751.164410-33-alexander.levin@microsoft.com> References: <20180924144751.164410-1-alexander.levin@microsoft.com> In-Reply-To: <20180924144751.164410-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Baruch Siach [ Upstream commit c4053ef322081554765e1b708d6cdd8855e1d72d ] Without a valid of_node in struct device we can't find the mvpp2 port device by its DT node. Specifically, this breaks of_find_net_device_by_node(). For example, the Armada 8040 based Clearfog GT-8K uses Marvell 88E6141 switch connected to the &cp1_eth2 port: &cp1_mdio { ... switch0: switch0@4 { compatible =3D "marvell,mv88e6085"; ... ports { ... port@5 { reg =3D <5>; label =3D "cpu"; ethernet =3D <&cp1_eth2>; }; }; }; }; Without this patch, dsa_register_switch() returns -EPROBE_DEFER because of_find_net_device_by_node() can't find the device_node of the &cp1_eth2 device. Reviewed-by: Andrew Lunn Signed-off-by: Baruch Siach Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/= ethernet/marvell/mvpp2/mvpp2_main.c index 0319ed9ef8b8..189fd1fe4ace 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -4694,6 +4694,7 @@ static int mvpp2_port_probe(struct platform_device *p= dev, dev->min_mtu =3D ETH_MIN_MTU; /* 9704 =3D=3D 9728 - 20 and rounding to 8 */ dev->max_mtu =3D MVPP2_BM_JUMBO_PKT_SIZE; + dev->dev.of_node =3D port_node; =20 /* Phylink isn't used w/ ACPI as of now */ if (port_node) { --=20 2.17.1