serdev: make synchronous write return bytes written
authorJohan Hovold <johan@kernel.org>
Wed, 14 Nov 2018 15:09:02 +0000 (16:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2018 18:44:21 +0000 (19:44 +0100)
commit0bbf0a88fa29de6a043ba40058409c7e550fc8be
treeba3ee078527db443cd492fa12f5c4d6862269e47
parent22d66c85fde3b1ca27ab596357e8e2505af7e388
serdev: make synchronous write return bytes written

Make the synchronous serdev_device_write() helper behave analogous to
the asynchronous serdev_device_write_buf() by returning the number of
bytes written (or rather buffered) also on timeout.

This will allow drivers to distinguish the case where data was partially
written from the case where no data was written.

Also update the only two users that checked the return value.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gnss/serial.c
drivers/gnss/sirf.c
drivers/tty/serdev/core.c