Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84ccfc37 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Mark Brown
Browse files

spi: fsl-espi: improve return value handling in fsl_espi_bufs



Return a proper status code from fsl_espi_bufs instead of returning
the number of remaining words and let the caller evaluate it.

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 809b1e01
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ static int fsl_espi_bufs(struct spi_device *spi, struct spi_transfer *t)
	/* disable rx ints */
	mpc8xxx_spi_write_reg(&reg_base->mask, 0);

	return mpc8xxx_spi->count;
	return mpc8xxx_spi->count > 0 ? -EMSGSIZE : 0;
}

static int fsl_espi_do_trans(struct spi_message *m, struct spi_transfer *trans)
@@ -288,9 +288,6 @@ static int fsl_espi_do_trans(struct spi_message *m, struct spi_transfer *trans)
	if (trans->len)
		ret = fsl_espi_bufs(spi, trans);

	if (ret)
		ret = -EMSGSIZE;

	if (trans->delay_usecs)
		udelay(trans->delay_usecs);