alistair23-linux/drivers/spi
Sebastian Siewior 4b1295b0df spi: fix the read path in spidev
This got broken by the recent "fix rmmod $spi_driver while spidev-user is
active".  I tested the rmmod & write path but didn't check the read path.
I am sorry.  The read logic changed and spidev_sync_read() +
spidev_sync_write() do not return zero on success anymore but the number
of bytes that has been transfered over the bus.  This patch changes the
logic and copy_to_user() gets called again.

The write path returns the number of bytes which are written to the
underlying device what may be less than the requested size.  This patch
makes the same change to the read path or else we request a read of 20
bytes, get 10, don't call copy to user and report to the user that we read
10 bytes.

[akpm@linux-foundation.org: remove test of known-to-be-zero local]
Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-04 10:40:08 -07:00
..
at25.c
atmel_spi.c atmel_spi: clean up baud rate divisor calculation 2008-04-30 08:29:31 -07:00
atmel_spi.h
au1550_spi.c
Kconfig spi_mpc83xx: much improved driver 2008-05-13 08:02:25 -07:00
Makefile
mpc52xx_psc_spi.c mpc5200_psc_spi: typo fix in header block 2008-05-14 19:11:12 -07:00
omap2_mcspi.c
omap_uwire.c spi: replace remaining __FUNCTION__ occurrences 2008-04-28 08:58:31 -07:00
pxa2xx_spi.c spi: pxa2xx_spi clock resume bugfix 2008-05-13 08:02:23 -07:00
spi.c
spi_bfin5xx.c spi_bfin5xx: use PIO for full duplex, not DMA 2008-05-01 08:04:01 -07:00
spi_bitbang.c spi: replace remaining __FUNCTION__ occurrences 2008-04-28 08:58:31 -07:00
spi_butterfly.c
spi_imx.c spi: spi_imx updates 2008-04-28 08:58:31 -07:00
spi_lm70llp.c
spi_mpc83xx.c spi_mpc83xx: much improved driver 2008-05-13 08:02:25 -07:00
spi_s3c24xx.c spi_s3c24xx signedness fix 2008-05-01 08:04:01 -07:00
spi_s3c24xx_gpio.c
spi_sh_sci.c
spi_txx9.c
spidev.c spi: fix the read path in spidev 2008-07-04 10:40:08 -07:00
tle62x0.c
xilinx_spi.c spi: replace remaining __FUNCTION__ occurrences 2008-04-28 08:58:31 -07:00