mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/1] smc911111: fix send and recv return value
Date: Mon, 25 Feb 2013 08:59:24 +0100	[thread overview]
Message-ID: <20130225075924.GM1906@pengutronix.de> (raw)
In-Reply-To: <1361698333-2727-1-git-send-email-plagnioj@jcrosoft.com>

On Sun, Feb 24, 2013 at 10:32:13AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> on error send error code and 0 on success
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>


Applied, thanks

Sascha

> ---
>  drivers/net/smc91111.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
> index 695fa7d..48183dd 100644
> --- a/drivers/net/smc91111.c
> +++ b/drivers/net/smc91111.c
> @@ -935,7 +935,7 @@ static int smc91c111_eth_send(struct eth_device *edev, void *packet,
>  
>  	if (numPages > 7) {
>  		printf ("%s: Far too big packet error. \n", SMC_DEV_NAME);
> -		return 0;
> +		return -EOVERFLOW;
>  	}
>  
>  	/* now, try to allocate the memory */
> @@ -965,7 +965,7 @@ again:
>  		if (try < SMC_ALLOC_MAX_TRY)
>  			goto again;
>  		else
> -			return 0;
> +			return -ETIMEDOUT;
>  	}
>  
>  	PRINTK2 ("%s: memory allocation, try %d succeeded ...\n",
> @@ -980,7 +980,7 @@ again:
>  	if (packet_no & AR_FAILED) {
>  		/* or isn't there?  BAD CHIP! */
>  		printf ("%s: Memory allocation failed. \n", SMC_DEV_NAME);
> -		return 0;
> +		return -ENOMEM;
>  	}
>  
>  	/* we have a packet address, so tell the card to use it */
> @@ -1046,7 +1046,7 @@ again:
>  	SMC_outb(priv, saved_pnr, PN_REG );
>  	SMC_outw(priv, saved_ptr, PTR_REG );
>  
> -	return length;
> +	return 0;
>  }
>  
>  static void smc91c111_eth_halt(struct eth_device *edev)
> @@ -1152,10 +1152,10 @@ static int smc91c111_eth_rx(struct eth_device *edev)
>  	if (!is_error) {
>  		/* Pass the packet up to the protocol layers. */
>  		net_receive(NetRxPackets[0], packet_length);
> -		return packet_length;
> +		return 0;
>  	}
>  
> -	return 0;
> +	return -EINVAL;
>  }
>  
>  static int smc91c111_get_ethaddr(struct eth_device *edev, unsigned char *m)
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2013-02-25  7:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24  9:32 Jean-Christophe PLAGNIOL-VILLARD
2013-02-25  7:59 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130225075924.GM1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox