* Based on smc91111_eeprom.c which:
* Heavily borrowed from the following peoples GPL'ed software:
* - Wolfgang Denk, DENX Software Engineering, wd@denx.de
- * Das U-boot
+ * Das U-Boot
* - Ladislav Michl ladis@linux-mips.org
* A rejected patch on the U-Boot mailing list
*/
#include <common.h>
+#include <console.h>
#include <exports.h>
-
-/* the smc911x.h gets base addr through eth_device' iobase */
-struct eth_device {
- const char *name;
- unsigned long iobase;
- void *priv;
-};
+#include <linux/ctype.h>
#include "../drivers/net/smc911x.h"
/**
*/
static char *skip_space(char *buf)
{
- while (buf[0] == ' ' || buf[0] == '\t')
+ while (isblank(buf[0]))
++buf;
return buf;
}
static int smc911x_init(struct eth_device *dev)
{
/* See if there is anything there */
- if (!smc911x_detect_chip(dev))
+ if (smc911x_detect_chip(dev))
return 1;
smc911x_reset(dev);
/**
* smc911x_eeprom - our application's main() function
*/
-int smc911x_eeprom(int argc, char *argv[])
+int smc911x_eeprom(int argc, char * const argv[])
{
/* Avoid initializing on stack as gcc likes to call memset() */
struct eth_device dev;
- dev.name = __func__;
dev.iobase = CONFIG_SMC911X_BASE;
/* Print the ABI version */
continue;
/* Only accept 1 letter commands */
- if (line[0] && line[1] && line[1] != ' ' && line[1] != '\t')
+ if (line[0] && line[1] && !isblank(line[1]))
goto unknown_cmd;
/* Now parse the command */