]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/plb2800_eth.c
Coding Style cleanup: replace leading SPACEs by TABs
[karo-tx-uboot.git] / drivers / net / plb2800_eth.c
index b8cc57aa78b3226a057e405c5eadd22d465c1af6..f869514f29511322ff3ff9414ccfa6c3f315e527 100644 (file)
@@ -4,32 +4,13 @@
  * (C) Copyright 2003
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_NET) \
-       && defined(CONFIG_NET_MULTI) && defined(CONFIG_PLB2800_ETHER)
-
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/addrspace.h>
 
 
@@ -85,8 +66,7 @@ typedef volatile struct {
 
 
 static int plb2800_eth_init(struct eth_device *dev, bd_t * bis);
-static int plb2800_eth_send(struct eth_device *dev, volatile void *packet,
-                                                 int length);
+static int plb2800_eth_send(struct eth_device *dev, void *packet, int length);
 static int plb2800_eth_recv(struct eth_device *dev);
 static void plb2800_eth_halt(struct eth_device *dev);
 
@@ -109,7 +89,7 @@ int plb2800_eth_initialize(bd_t * bis)
        if (!(dev = (struct eth_device *) malloc (sizeof *dev)))
        {
                printf("Failed to allocate memory\n");
-               return 0;
+               return -1;
        }
        memset(dev, 0, sizeof(*dev));
 
@@ -144,7 +124,7 @@ int plb2800_eth_initialize(bd_t * bis)
        printf("Leaving plb2800_eth_initialize()\n");
 #endif
 
-       return 1;
+       return 0;
 }
 
 static int plb2800_eth_init(struct eth_device *dev, bd_t * bis)
@@ -165,8 +145,7 @@ static int plb2800_eth_init(struct eth_device *dev, bd_t * bis)
 }
 
 
-static int plb2800_eth_send(struct eth_device *dev, volatile void *packet,
-                                                 int length)
+static int plb2800_eth_send(struct eth_device *dev, void *packet, int length)
 {
        int                    i;
        int                    res         = -1;
@@ -281,7 +260,7 @@ static int plb2800_eth_recv(struct eth_device *dev)
                        printf("Received %d bytes\n", length);
 #endif
                        NetReceive((void*)(NetRxPackets[rx_new]),
-                                   length - 4);
+                                   length - 4);
                }
                else
                {
@@ -392,5 +371,3 @@ static unsigned char * plb2800_get_mac_addr(void)
 
        return addr;
 }
-
-#endif /* CONFIG_PLB2800_ETHER */