From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bl2nam02on0113.outbound.protection.outlook.com ([104.47.38.113]:13185 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753199AbeBCSDC (ORCPT ); Sat, 3 Feb 2018 13:03:02 -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.14 102/110] SolutionEngine771x: fix Ether platform data Date: Sat, 3 Feb 2018 18:01:32 +0000 Message-ID: <20180203180015.29073-102-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-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 77c35350ee77..b7fa7a87e946 100644 --- a/arch/sh/boards/mach-se/770x/setup.c +++ b/arch/sh/boards/mach-se/770x/setup.c @@ -9,6 +9,7 @@ */ #include #include +#include #include #include #include @@ -115,6 +116,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, @@ -132,7 +138,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, @@ -155,7 +161,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