[U-Boot] [PATCH RFC] smc911x: enable mii commands
Helmut Raiger
helmut.raiger at hale.at
Mon Jul 4 11:41:45 CEST 2011
On 06/30/2011 04:02 PM, Luca Ceresoli wrote:
> +static int smc911x_miiphy_read_byname(char *devname, unsigned char addr,
> + unsigned char reg, unsigned short *value)
> +{
> + struct eth_device *dev;
> +
> + if (devname == NULL)
> + return -1;
> +
> + dev = eth_get_dev_by_name(devname);
You're right. eth_get_dev_by_name() is not safe for devname == NULL as
it uses strcmp().
Best would be to fix this there, I'll adjust my patch accordingly.
> +
> + if (dev == NULL) {
> + printf(DRIVERNAME ": device %s not found\n", devname);
> + return -1;
> + }
None of the other drivers in drivers/net add this kind of verbosity, so
I tend to leave it at that.
Helmut
--
Scanned by MailScanner.
More information about the U-Boot
mailing list