Merge commit 'origin/master'
[oweals/u-boot.git] / drivers / natsemi.c
index 5a8c5b4ecc1d2d815683c6cd78464e23bcfd936d..075d6c52c45cdd97c7f6d458453a5d0a06863c1a 100644 (file)
@@ -56,8 +56,8 @@
 #include <asm/io.h>
 #include <pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
-       defined(CONFIG_NATSEMI)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_NATSEMI)
 
 /* defines */
 #define EEPROM_SIZE 0xb /*12 16-bit chunks, or 24 bytes*/
@@ -307,7 +307,7 @@ natsemi_initialize(bd_t * bis)
                }
 
                pci_read_config_dword(devno, PCI_BASE_ADDRESS_0, &iobase);
-               iobase &= ~0x3; /* 1: unused and 0:I/O Space Indicator */
+               iobase &= ~0x3; /* bit 1: unused and bit 0: I/O Space Indicator */
 
                pci_write_config_dword(devno, PCI_COMMAND,
                                       PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
@@ -756,6 +756,7 @@ natsemi_send(struct eth_device *dev, volatile void *packet, int length)
 {
        u32 i, status = 0;
        u32 tx_status = 0;
+       vu_long *res = (vu_long *)&tx_status;
 
        /* Stop the transmitter */
        OUTL(dev, TxOff, ChipCmd);
@@ -781,7 +782,7 @@ natsemi_send(struct eth_device *dev, volatile void *packet, int length)
        OUTL(dev, TxOn, ChipCmd);
 
        for (i = 0;
-            ((vu_long)tx_status = le32_to_cpu(txd.cmdsts)) & DescOwn;
+            (*res = le32_to_cpu(txd.cmdsts)) & DescOwn;
             i++) {
                if (i >= TOUT_LOOP) {
                        printf