sh_eth: fix SH7757 GEther initialization
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thu, 4 Jan 2018 18:06:49 +0000 (21:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:45:22 +0000 (09:45 +0100)
commit705813e942332a4eb63f0cfcb3cd054b4e1d34a7
tree1d1f52be8c13c0f7d8aae7980592dee96098baf7
parentdb21b74346d7cbbf4cca94fac6b634b3e52e9d56
sh_eth: fix SH7757 GEther initialization

[ Upstream commit 5133550296d43236439494aa955bfb765a89f615 ]

Renesas  SH7757 has 2 Fast and 2 Gigabit Ether controllers, while the
'sh_eth' driver can only reset and initialize TSU of the first controller
pair. Shimoda-san tried to solve that adding the 'needs_init' member to the
'struct sh_eth_plat_data', however the platform code still never sets this
flag. I think  that we can infer this information from the 'devno' variable
(set  to 'platform_device::id') and reset/init the Ether controller pair
only for an even 'devno'; therefore 'sh_eth_plat_data::needs_init' can be
removed...

Fixes: 150647fb2c31 ("net: sh_eth: change the condition of initialization")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/renesas/sh_eth.c
include/linux/sh_eth.h