Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu...@renesas.com>
---
 drivers/net/sh_eth.c |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index c1abe7c..e29061c 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -60,7 +60,8 @@ int sh_eth_send(struct eth_device *dev, volatile void 
*packet, int len)
 
        /* packet must be a 4 byte boundary */
        if ((int)packet & 3) {
-               printf(SHETHER_NAME ": %s: packet not 4 byte alligned\n", 
__func__);
+               printf(SHETHER_NAME
+                       ": %s: packet not 4 byte alligned\n" , __func__);
                ret = -EFAULT;
                goto err;
        }
@@ -141,6 +142,8 @@ static int sh_eth_reset(struct sh_eth_dev *eth)
 #if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734)
        int ret = 0, i;
 
+       port = eth->port;
+
        /* Start e-dmac transmitter and receiver */
        outl(EDSR_ENALL, EDSR(port));
 
@@ -159,6 +162,8 @@ static int sh_eth_reset(struct sh_eth_dev *eth)
 
        return ret;
 #else
+       port = eth->port;
+
        outl(inl(EDMR(port)) | EDMR_SRST, EDMR(port));
        udelay(3000);
        outl(inl(EDMR(port)) & ~EDMR_SRST, EDMR(port));
@@ -564,8 +569,10 @@ static int sh_eth_bb_init(struct bb_miiphy_bus *bus)
 
 static int sh_eth_bb_mdio_active(struct bb_miiphy_bus *bus)
 {
+       int port;
        struct sh_eth_dev *eth = bus->priv;
-       int port = eth->port;
+
+       port = eth->port;
 
        outl(inl(PIR(port)) | PIR_MMD, PIR(port));
 
@@ -574,8 +581,10 @@ static int sh_eth_bb_mdio_active(struct bb_miiphy_bus *bus)
 
 static int sh_eth_bb_mdio_tristate(struct bb_miiphy_bus *bus)
 {
+       int port;
        struct sh_eth_dev *eth = bus->priv;
-       int port = eth->port;
+
+       port = eth->port;
 
        outl(inl(PIR(port)) & ~PIR_MMD, PIR(port));
 
@@ -584,8 +593,10 @@ static int sh_eth_bb_mdio_tristate(struct bb_miiphy_bus 
*bus)
 
 static int sh_eth_bb_set_mdio(struct bb_miiphy_bus *bus, int v)
 {
+       int port;
        struct sh_eth_dev *eth = bus->priv;
-       int port = eth->port;
+
+       port = eth->port;
 
        if (v)
                outl(inl(PIR(port)) | PIR_MDO, PIR(port));
@@ -597,8 +608,10 @@ static int sh_eth_bb_set_mdio(struct bb_miiphy_bus *bus, 
int v)
 
 static int sh_eth_bb_get_mdio(struct bb_miiphy_bus *bus, int *v)
 {
+       int port;
        struct sh_eth_dev *eth = bus->priv;
-       int port = eth->port;
+
+       port = eth->port;
 
        *v = (inl(PIR(port)) & PIR_MDI) >> 3;
 
@@ -607,8 +620,10 @@ static int sh_eth_bb_get_mdio(struct bb_miiphy_bus *bus, 
int *v)
 
 static int sh_eth_bb_set_mdc(struct bb_miiphy_bus *bus, int v)
 {
+       int port;
        struct sh_eth_dev *eth = bus->priv;
-       int port = eth->port;
+
+       port = eth->port;
 
        if (v)
                outl(inl(PIR(port)) | PIR_MDC, PIR(port));
-- 
1.7.7.3

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to