X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=examples%2Fstandalone%2Fsmc911x_eeprom.c;h=6c79c5f65a0f74236f46c1f0da26612d3705d435;hb=1c1c7506de1051df6d81c51a06a57be6406b534c;hp=fff312346460e375fc4cea64483c7138a508e4a8;hpb=3c014f1586d5bfe30dca7549396915c83f31cd30;p=u-boot diff --git a/examples/standalone/smc911x_eeprom.c b/examples/standalone/smc911x_eeprom.c index fff3123464..6c79c5f65a 100644 --- a/examples/standalone/smc911x_eeprom.c +++ b/examples/standalone/smc911x_eeprom.c @@ -16,13 +16,7 @@ #include #include - -/* the smc911x.h gets base addr through eth_device' iobase */ -struct eth_device { - const char *name; - unsigned long iobase; - void *priv; -}; +#include #include "../drivers/net/smc911x.h" /** @@ -135,7 +129,7 @@ static int write_eeprom_reg(struct eth_device *dev, u8 value, u8 reg) */ static char *skip_space(char *buf) { - while (buf[0] == ' ' || buf[0] == '\t') + while (isblank(buf[0])) ++buf; return buf; } @@ -247,7 +241,7 @@ static void dump_eeprom(struct eth_device *dev) 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); @@ -320,11 +314,10 @@ static char *getline(void) /** * 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 */ @@ -365,7 +358,7 @@ int smc911x_eeprom(int argc, char *argv[]) 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 */