From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] spi: mvebu: fix error handling for transfer problems
Date: Wed, 7 Dec 2016 20:31:09 +0100 [thread overview]
Message-ID: <20161207193109.bx3krk5ukcnakjgd@pengutronix.de> (raw)
In-Reply-To: <20161205102743.3896-1-u.kleine-koenig@pengutronix.de>
On Mon, Dec 05, 2016 at 11:27:43AM +0100, Uwe Kleine-König wrote:
> When a message transfer fails no further messages are transferred, but
> the error value was not propagated to the caller.
>
> Fixes: 5db1a578d6ed ("spi: add Marvell MVEBU SoC SPI driver")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/spi/mvebu_spi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/spi/mvebu_spi.c b/drivers/spi/mvebu_spi.c
> index 335774d4c609..ee7b212962f7 100644
> --- a/drivers/spi/mvebu_spi.c
> +++ b/drivers/spi/mvebu_spi.c
> @@ -305,14 +305,14 @@ static int mvebu_spi_transfer(struct spi_device *spi, struct spi_message *msg)
> list_for_each_entry(t, &msg->transfers, transfer_list) {
> ret = mvebu_spi_do_transfer(spi, t);
> if (ret)
> - break;
> + goto err_transfer;
> msg->actual_length += t->len;
> }
>
> - ret = mvebu_spi_set_cs(priv, spi->chip_select, spi->mode, false);
> - if (ret)
> - return ret;
> + return mvebu_spi_set_cs(priv, spi->chip_select, spi->mode, false);
>
> +err_transfer:
> + mvebu_spi_set_cs(priv, spi->chip_select, spi->mode, false);
> return ret;
> }
>
> --
> 2.10.2
>
>
> _______________________________________________
> 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
prev parent reply other threads:[~2016-12-07 19:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 10:27 Uwe Kleine-König
2016-12-07 19:31 ` 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=20161207193109.bx3krk5ukcnakjgd@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=u.kleine-koenig@pengutronix.de \
/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