staging: ft1000: change values of status return variable in write_dpram32_and_check
authorKelley Nielsen <kelleynnn@gmail.com>
Tue, 29 Oct 2013 21:54:31 +0000 (14:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Oct 2013 00:10:22 +0000 (17:10 -0700)
commit43fc69b1122b8a3e540b9d6ab36dc9840fa918ff
tree9307fcaa1ab4886871a9166ed451d5df3f653d78
parent2fef7e13c88698c165d42778abce3bb95f2238ea
staging: ft1000: change values of status return variable in write_dpram32_and_check

The ft1000 usb driver ignores expected Linux error codes, and uses two
values defined in ft1000_usb.h: STATUS_SUCCESS 0, and STATUS_FAILURE
0x1001; and sometimes -1. This patch changes the return value of the
function write_dpram_32_and check to 0 or -EREMOTEIO, respectively. The
relevant change was made in the helper function check_buffers (which is
only called from write_dpram32_and_check); it now returns 0 on success
and -EREMOTEIO on failure, and this is allowed to propagate through
write_dpram32_and_check. Assignments to the return variable status that
are no longer needed were removed as well. In one function up the call
chain, dsp_reload in ft1000_hw.c, the status variable was changed from
u16 to int to avoid collecting a signed value in an unsigned variable.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ft1000/ft1000-usb/ft1000_download.c
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c