diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2013-06-07 09:59:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-08 02:38:24 -0400 |
commit | 24549e2a0f33628b5160eac16c6aebf1cfaf22f1 (patch) | |
tree | 7c5e2715d338bf9af01342d7b4036097b5c6daed /drivers/net/ethernet/renesas | |
parent | f5d12767c8fd77e29d3d6771de59fd9ac3e540bb (diff) |
sh_eth: get SH7757 support out of #ifdef
Get the SH7757 code/data in the driver out of #ifdef by adding "sh7757-ether"
and "sh7757-gether" to the platform driver's ID table. Note that we can remove
SH_ETH_HAS_BOTH_MODULES and sh_eth_get_cpu_data().
Change the Ether/GEther platform devices' names in the SH 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/net/ethernet/renesas')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 6d44a43e5884..9860fc028f3d 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -431,10 +431,9 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | |||
431 | .rpadir = 1, | 431 | .rpadir = 1, |
432 | .rpadir_value = 0x00020000, /* NET_IP_ALIGN assumed to be 2 */ | 432 | .rpadir_value = 0x00020000, /* NET_IP_ALIGN assumed to be 2 */ |
433 | }; | 433 | }; |
434 | #elif defined(CONFIG_CPU_SUBTYPE_SH7757) | 434 | #endif |
435 | #define SH_ETH_HAS_BOTH_MODULES 1 | ||
436 | 435 | ||
437 | static void sh_eth_set_rate(struct net_device *ndev) | 436 | static void sh_eth_set_rate_sh7757(struct net_device *ndev) |
438 | { | 437 | { |
439 | struct sh_eth_private *mdp = netdev_priv(ndev); | 438 | struct sh_eth_private *mdp = netdev_priv(ndev); |
440 | 439 | ||
@@ -451,9 +450,9 @@ static void sh_eth_set_rate(struct net_device *ndev) | |||
451 | } | 450 | } |
452 | 451 | ||
453 | /* SH7757 */ | 452 | /* SH7757 */ |
454 | static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | 453 | static struct sh_eth_cpu_data sh7757_data = { |
455 | .set_duplex = sh_eth_set_duplex, | 454 | .set_duplex = sh_eth_set_duplex, |
456 | .set_rate = sh_eth_set_rate, | 455 | .set_rate = sh_eth_set_rate_sh7757, |
457 | 456 | ||
458 | .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff, | 457 | .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff, |
459 | .rmcr_value = 0x00000001, | 458 | .rmcr_value = 0x00000001, |
@@ -518,7 +517,7 @@ static void sh_eth_set_rate_giga(struct net_device *ndev) | |||
518 | } | 517 | } |
519 | 518 | ||
520 | /* SH7757(GETHERC) */ | 519 | /* SH7757(GETHERC) */ |
521 | static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = { | 520 | static struct sh_eth_cpu_data sh7757_data_giga = { |
522 | .chip_reset = sh_eth_chip_reset_giga, | 521 | .chip_reset = sh_eth_chip_reset_giga, |
523 | .set_duplex = sh_eth_set_duplex, | 522 | .set_duplex = sh_eth_set_duplex, |
524 | .set_rate = sh_eth_set_rate_giga, | 523 | .set_rate = sh_eth_set_rate_giga, |
@@ -549,15 +548,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = { | |||
549 | .tsu = 1, | 548 | .tsu = 1, |
550 | }; | 549 | }; |
551 | 550 | ||
552 | static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp) | ||
553 | { | ||
554 | if (sh_eth_is_gether(mdp)) | ||
555 | return &sh_eth_my_cpu_data_giga; | ||
556 | else | ||
557 | return &sh_eth_my_cpu_data; | ||
558 | } | ||
559 | #endif | ||
560 | |||
561 | static void sh_eth_chip_reset(struct net_device *ndev) | 551 | static void sh_eth_chip_reset(struct net_device *ndev) |
562 | { | 552 | { |
563 | struct sh_eth_private *mdp = netdev_priv(ndev); | 553 | struct sh_eth_private *mdp = netdev_priv(ndev); |
@@ -2577,11 +2567,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) | |||
2577 | mdp->reg_offset = sh_eth_get_register_offset(pd->register_type); | 2567 | mdp->reg_offset = sh_eth_get_register_offset(pd->register_type); |
2578 | 2568 | ||
2579 | /* set cpu data */ | 2569 | /* set cpu data */ |
2580 | #if defined(SH_ETH_HAS_BOTH_MODULES) | ||
2581 | mdp->cd = sh_eth_get_cpu_data(mdp); | ||
2582 | #else | ||
2583 | mdp->cd = &sh_eth_my_cpu_data; | 2570 | mdp->cd = &sh_eth_my_cpu_data; |
2584 | #endif | ||
2585 | if (id->driver_data) | 2571 | if (id->driver_data) |
2586 | mdp->cd = (struct sh_eth_cpu_data *)id->driver_data; | 2572 | mdp->cd = (struct sh_eth_cpu_data *)id->driver_data; |
2587 | sh_eth_set_default_cpu_data(mdp->cd); | 2573 | sh_eth_set_default_cpu_data(mdp->cd); |
@@ -2702,6 +2688,8 @@ static struct platform_device_id sh_eth_id_table[] = { | |||
2702 | { "sh7619-ether", (kernel_ulong_t)&sh7619_data }, | 2688 | { "sh7619-ether", (kernel_ulong_t)&sh7619_data }, |
2703 | { "sh771x-ether", (kernel_ulong_t)&sh771x_data }, | 2689 | { "sh771x-ether", (kernel_ulong_t)&sh771x_data }, |
2704 | { "sh7734-gether", (kernel_ulong_t)&sh7734_data }, | 2690 | { "sh7734-gether", (kernel_ulong_t)&sh7734_data }, |
2691 | { "sh7757-ether", (kernel_ulong_t)&sh7757_data }, | ||
2692 | { "sh7757-gether", (kernel_ulong_t)&sh7757_data_giga }, | ||
2705 | { "sh7763-gether", (kernel_ulong_t)&sh7763_data }, | 2693 | { "sh7763-gether", (kernel_ulong_t)&sh7763_data }, |
2706 | { "r8a7740-gether", (kernel_ulong_t)&r8a7740_data }, | 2694 | { "r8a7740-gether", (kernel_ulong_t)&r8a7740_data }, |
2707 | { CARDNAME }, | 2695 | { CARDNAME }, |