mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 01:51:53 +00:00
sh_eth: remove duplicate sh_eth_set_duplex() definitions
Remove all the duplicate definitions of sh_eth_set_duplex() under different #ifdef's, leaving only one outside the #ifdef's. We have to annotate it with '__maybe_unused' since it's called not from all SoC #ifdef blocks. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> [Sergei: annotated sh_eth_set_duplex() as '__maybe_unused', added the changelog, reworded the subject, changing the prefix.] Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ddcd91c6b8
commit
04b0ed2ad4
@ -341,10 +341,7 @@ static void sh_eth_select_mii(struct net_device *ndev)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* There is CPU dependent code */
|
||||
#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
|
||||
#define SH_ETH_RESET_DEFAULT 1
|
||||
static void sh_eth_set_duplex(struct net_device *ndev)
|
||||
static void __maybe_unused sh_eth_set_duplex(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
|
||||
@ -354,6 +351,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
|
||||
}
|
||||
|
||||
/* There is CPU dependent code */
|
||||
#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
|
||||
#define SH_ETH_RESET_DEFAULT 1
|
||||
static void sh_eth_set_rate(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
@ -391,15 +391,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
|
||||
};
|
||||
#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
|
||||
#define SH_ETH_RESET_DEFAULT 1
|
||||
static void sh_eth_set_duplex(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
|
||||
if (mdp->duplex) /* Full */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
|
||||
else /* Half */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
|
||||
}
|
||||
|
||||
static void sh_eth_set_rate(struct net_device *ndev)
|
||||
{
|
||||
@ -443,16 +434,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
|
||||
#define SH_ETH_HAS_TSU 1
|
||||
static int sh_eth_check_reset(struct net_device *ndev);
|
||||
|
||||
static void sh_eth_set_duplex(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
|
||||
if (mdp->duplex) /* Full */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
|
||||
else /* Half */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
|
||||
}
|
||||
|
||||
static void sh_eth_set_rate(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
@ -552,16 +533,6 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void sh_eth_set_duplex_giga(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
|
||||
if (mdp->duplex) /* Full */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
|
||||
else /* Half */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
|
||||
}
|
||||
|
||||
static void sh_eth_set_rate_giga(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
@ -584,7 +555,7 @@ static void sh_eth_set_rate_giga(struct net_device *ndev)
|
||||
/* SH7757(GETHERC) */
|
||||
static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = {
|
||||
.chip_reset = sh_eth_chip_reset_giga,
|
||||
.set_duplex = sh_eth_set_duplex_giga,
|
||||
.set_duplex = sh_eth_set_duplex,
|
||||
.set_rate = sh_eth_set_rate_giga,
|
||||
|
||||
.ecsr_value = ECSR_ICD | ECSR_MPD,
|
||||
@ -634,16 +605,6 @@ static void sh_eth_chip_reset(struct net_device *ndev)
|
||||
mdelay(1);
|
||||
}
|
||||
|
||||
static void sh_eth_set_duplex(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
|
||||
if (mdp->duplex) /* Full */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
|
||||
else /* Half */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
|
||||
}
|
||||
|
||||
static void sh_eth_set_rate(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
@ -771,16 +732,6 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void sh_eth_set_duplex(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
|
||||
if (mdp->duplex) /* Full */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
|
||||
else /* Half */
|
||||
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
|
||||
}
|
||||
|
||||
static void sh_eth_set_rate(struct net_device *ndev)
|
||||
{
|
||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||
|
Loading…
Reference in New Issue
Block a user