[U-Boot] [PATCH] smc911x: make smc911x_initialize return correct value (Was: Re: [PATCH 1/5] smc911x: return -1 when initialization fails)
Mike Frysinger
vapier at gentoo.org
Fri Nov 13 04:44:31 CET 2009
On Thursday 12 November 2009 08:35:08 Mike Rapoport wrote:
> Mike Frysinger wrote:
> > On Wednesday 11 November 2009 03:03:00 Mike Rapoport wrote:
> >> --- a/drivers/net/smc911x.c
> >> +++ b/drivers/net/smc911x.c
> >> @@ -243,7 +243,7 @@
> >> dev = malloc(sizeof(*dev));
> >> if (!dev) {
> >> free(dev);
> >> - return 0;
> >> + return -1;
> >> }
> >
> > this is correct as this is an error
> >
> >> @@ -252,7 +252,7 @@
> >> /* Try to detect chip. Will fail if not present. */
> >> if (smc911x_detect_chip(dev)) {
> >> free(dev);
> >> - return 0;
> >> + return -1;
> >> }
> >
> > this is not -- we want it to return 0 if no parts are found. see recent
> > net doc updates and discussions.
>
> Hope this one is better:
>
> From 4a9420704dd81a08f950017d365e0826880536ed Mon Sep 17 00:00:00 2001
> From: Mike Rapoport <mike at compulab.co.il>
> Date: Tue, 10 Nov 2009 15:31:46 +0200
> Subject: [PATCH] smc911x: make smc911x_initialize return correct value
>
> Make smc911x_initialize return -1 on error and number of interfaces
> detected otherwise.
Acked-by: Mike Frysinger <vapier at gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091112/9c076d13/attachment.pgp
More information about the U-Boot
mailing list