aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2013-06-07 10:05:59 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-08 02:38:24 -0400
commit589ebdef7e3107401bf96a9c660753d397329ee9 (patch)
treee6247ac75c5992bbfad453c3c50526d540945901 /drivers
parent9c3beaabb951d672b1534c7f56f84054b088f879 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 143e22e1b329..cff697118119 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -356,8 +356,7 @@ static void __maybe_unused sh_eth_set_duplex(struct net_device *ndev)
356} 356}
357 357
358/* There is CPU dependent code */ 358/* There is CPU dependent code */
359#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779) 359static void sh_eth_set_rate_r8a777x(struct net_device *ndev)
360static void sh_eth_set_rate(struct net_device *ndev)
361{ 360{
362 struct sh_eth_private *mdp = netdev_priv(ndev); 361 struct sh_eth_private *mdp = netdev_priv(ndev);
363 362
@@ -374,9 +373,9 @@ static void sh_eth_set_rate(struct net_device *ndev)
374} 373}
375 374
376/* R8A7778/9 */ 375/* R8A7778/9 */
377static struct sh_eth_cpu_data sh_eth_my_cpu_data = { 376static struct sh_eth_cpu_data r8a777x_data = {
378 .set_duplex = sh_eth_set_duplex, 377 .set_duplex = sh_eth_set_duplex,
379 .set_rate = sh_eth_set_rate, 378 .set_rate = sh_eth_set_rate_r8a777x,
380 379
381 .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD, 380 .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD,
382 .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP, 381 .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP,
@@ -392,7 +391,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
392 .tpauser = 1, 391 .tpauser = 1,
393 .hw_swap = 1, 392 .hw_swap = 1,
394}; 393};
395#endif
396 394
397static void sh_eth_set_rate_sh7724(struct net_device *ndev) 395static void sh_eth_set_rate_sh7724(struct net_device *ndev)
398{ 396{
@@ -2566,9 +2564,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2566 mdp->reg_offset = sh_eth_get_register_offset(pd->register_type); 2564 mdp->reg_offset = sh_eth_get_register_offset(pd->register_type);
2567 2565
2568 /* set cpu data */ 2566 /* set cpu data */
2569 mdp->cd = &sh_eth_my_cpu_data; 2567 mdp->cd = (struct sh_eth_cpu_data *)id->driver_data;
2570 if (id->driver_data)
2571 mdp->cd = (struct sh_eth_cpu_data *)id->driver_data;
2572 sh_eth_set_default_cpu_data(mdp->cd); 2568 sh_eth_set_default_cpu_data(mdp->cd);
2573 2569
2574 /* set function */ 2570 /* set function */
@@ -2692,7 +2688,7 @@ static struct platform_device_id sh_eth_id_table[] = {
2692 { "sh7757-gether", (kernel_ulong_t)&sh7757_data_giga }, 2688 { "sh7757-gether", (kernel_ulong_t)&sh7757_data_giga },
2693 { "sh7763-gether", (kernel_ulong_t)&sh7763_data }, 2689 { "sh7763-gether", (kernel_ulong_t)&sh7763_data },
2694 { "r8a7740-gether", (kernel_ulong_t)&r8a7740_data }, 2690 { "r8a7740-gether", (kernel_ulong_t)&r8a7740_data },
2695 { CARDNAME }, 2691 { "r8a777x-ether", (kernel_ulong_t)&r8a777x_data },
2696 { } 2692 { }
2697}; 2693};
2698MODULE_DEVICE_TABLE(platform, sh_eth_id_table); 2694MODULE_DEVICE_TABLE(platform, sh_eth_id_table);