sh_eth: get R8A777x support out of #ifdef
Get the R-Car code/data in the driver out of #ifdef by adding "r8a777x-ether" to
the platfrom driver's ID table; since it's the last #ifdef, we remove CARDNAME
from the ID table and no longer check the driver data before assigning it to
'mdp->cd'...
Change the Ether platform device's name in the ARM platform code accordingly.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 143e22e..cff6971 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -356,8 +356,7 @@
}
/* There is CPU dependent code */
-#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
-static void sh_eth_set_rate(struct net_device *ndev)
+static void sh_eth_set_rate_r8a777x(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -374,9 +373,9 @@
}
/* R8A7778/9 */
-static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
+static struct sh_eth_cpu_data r8a777x_data = {
.set_duplex = sh_eth_set_duplex,
- .set_rate = sh_eth_set_rate,
+ .set_rate = sh_eth_set_rate_r8a777x,
.ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD,
.ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP,
@@ -392,7 +391,6 @@
.tpauser = 1,
.hw_swap = 1,
};
-#endif
static void sh_eth_set_rate_sh7724(struct net_device *ndev)
{
@@ -2566,9 +2564,7 @@
mdp->reg_offset = sh_eth_get_register_offset(pd->register_type);
/* set cpu data */
- mdp->cd = &sh_eth_my_cpu_data;
- if (id->driver_data)
- mdp->cd = (struct sh_eth_cpu_data *)id->driver_data;
+ mdp->cd = (struct sh_eth_cpu_data *)id->driver_data;
sh_eth_set_default_cpu_data(mdp->cd);
/* set function */
@@ -2692,7 +2688,7 @@
{ "sh7757-gether", (kernel_ulong_t)&sh7757_data_giga },
{ "sh7763-gether", (kernel_ulong_t)&sh7763_data },
{ "r8a7740-gether", (kernel_ulong_t)&r8a7740_data },
- { CARDNAME },
+ { "r8a777x-ether", (kernel_ulong_t)&r8a777x_data },
{ }
};
MODULE_DEVICE_TABLE(platform, sh_eth_id_table);