Return-Path: Received: from mail-by2nam03on0126.outbound.protection.outlook.com ([104.47.42.126]:45078 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753162AbeBCSFJ (ORCPT ); Sat, 3 Feb 2018 13:05:09 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Sergei Shtylyov , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 48/52] SolutionEngine771x: fix Ether platform data Date: Sat, 3 Feb 2018 18:03:59 +0000 Message-ID: <20180203180303.8490-48-alexander.levin@microsoft.com> References: <20180203180303.8490-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180303.8490-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: Sergei Shtylyov [ Upstream commit 195e2addbce09e5afbc766efc1e6567c9ce840d3 ] The 'sh_eth' driver's probe() method would fail on the SolutionEngine7710 board and crash on SolutionEngine7712 board as the platform code is hopelessly behind the driver's platform data -- it passes the PHY address instead of 'struct sh_eth_plat_data *'; pass the latter to the driver in order to fix the bug... Fixes: 71557a37adb5 ("[netdrvr] sh_eth: Add SH7619 support") Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- arch/sh/boards/mach-se/770x/setup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/7= 70x/setup.c index 658326f44df8..5e0267624d8d 100644 --- a/arch/sh/boards/mach-se/770x/setup.c +++ b/arch/sh/boards/mach-se/770x/setup.c @@ -8,6 +8,7 @@ */ #include #include +#include #include #include #include @@ -114,6 +115,11 @@ static struct platform_device heartbeat_device =3D { #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\ defined(CONFIG_CPU_SUBTYPE_SH7712) /* SH771X Ethernet driver */ +static struct sh_eth_plat_data sh_eth_plat =3D { + .phy =3D PHY_ID, + .phy_interface =3D PHY_INTERFACE_MODE_MII, +}; + static struct resource sh_eth0_resources[] =3D { [0] =3D { .start =3D SH_ETH0_BASE, @@ -131,7 +137,7 @@ static struct platform_device sh_eth0_device =3D { .name =3D "sh771x-ether", .id =3D 0, .dev =3D { - .platform_data =3D PHY_ID, + .platform_data =3D &sh_eth_plat, }, .num_resources =3D ARRAY_SIZE(sh_eth0_resources), .resource =3D sh_eth0_resources, @@ -154,7 +160,7 @@ static struct platform_device sh_eth1_device =3D { .name =3D "sh771x-ether", .id =3D 1, .dev =3D { - .platform_data =3D PHY_ID, + .platform_data =3D &sh_eth_plat, }, .num_resources =3D ARRAY_SIZE(sh_eth1_resources), .resource =3D sh_eth1_resources, --=20 2.11.0