Commit 51335502 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

sh_eth: fix SH7757 GEther initialization

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: 150647fb ("net: sh_eth: change the condition of initialization")
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3e6e867a
...@@ -3254,8 +3254,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -3254,8 +3254,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER; ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
} }
/* initialize first or needed device */ /* Need to init only the first port of the two sharing a TSU */
if (!devno || pd->needs_init) { if (devno % 2 == 0) {
if (mdp->cd->chip_reset) if (mdp->cd->chip_reset)
mdp->cd->chip_reset(ndev); mdp->cd->chip_reset(ndev);
......
...@@ -17,7 +17,6 @@ struct sh_eth_plat_data { ...@@ -17,7 +17,6 @@ struct sh_eth_plat_data {
unsigned char mac_addr[ETH_ALEN]; unsigned char mac_addr[ETH_ALEN];
unsigned no_ether_link:1; unsigned no_ether_link:1;
unsigned ether_link_active_low:1; unsigned ether_link_active_low:1;
unsigned needs_init:1;
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment