spi: atmel: sam9m10g45 also support WDRBT bit
[pandora-u-boot.git] / drivers / net / cs8900.c
index df36004..6aaa0cf 100644 (file)
 static u16 get_reg_init_bus(struct eth_device *dev, int regno)
 {
        /* force 16 bit busmode */
-       volatile u8 c;
        struct cs8900_priv *priv = (struct cs8900_priv *)(dev->priv);
        uint8_t volatile * const iob = (uint8_t volatile * const)dev->iobase;
 
-       c = readb(iob);
-       c = readb(iob + 1);
-       c = readb(iob);
-       c = readb(iob + 1);
-       c = readb(iob);
+       readb(iob);
+       readb(iob + 1);
+       readb(iob);
+       readb(iob + 1);
+       readb(iob);
 
        REG_WRITE(regno, &priv->regs->pptr);
        return REG_READ(&priv->regs->pdata);
@@ -216,8 +215,7 @@ static int cs8900_recv(struct eth_device *dev)
 }
 
 /* Send a data block via Ethernet. */
-static int cs8900_send(struct eth_device *dev,
-                       volatile void *packet, int length)
+static int cs8900_send(struct eth_device *dev, void *packet, int length)
 {
        volatile u16 *addr;
        int tmo;
@@ -308,14 +306,13 @@ int cs8900_initialize(u8 dev_num, int base_addr)
 
        dev = malloc(sizeof(*dev));
        if (!dev) {
-               free(dev);
                return 0;
        }
        memset(dev, 0, sizeof(*dev));
 
        priv = malloc(sizeof(*priv));
        if (!priv) {
-               free(priv);
+               free(dev);
                return 0;
        }
        memset(priv, 0, sizeof(*priv));