OSDN Git Service

staging: ks7010: refactor SDIO read/write helpers
authorTobin C. Harding <me@tobin.cc>
Tue, 18 Apr 2017 00:35:41 +0000 (10:35 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Apr 2017 11:47:31 +0000 (13:47 +0200)
commitf1e79f4b96c1fa21dfbfda48d511cc88c84e875f
tree5e655357daeeb967d97792f1381adb342fe9c35c
parenta9d58d9ad8b48c9363cb157f41e92ba144462990
staging: ks7010: refactor SDIO read/write helpers

Driver SDIO code uses helper functions to do IO to the SDIO
device. Current helpers handle IO of a single byte as well as
multi-byte. Driver predominately uses single byte IO. If the
common case is made simple it simplifies the whole driver. The common
case can be made simple by splitting the multi-byte and single byte
calls into separate functions, i.e 4 functions in total, read single
byte, read multi-byte, write single byte, write multi-byte.

Also, we need to handle the debug code. Currently debug calls after
read/write fail access the IO buffer. This buffer, at best, does not hold
useful data on the error path, at worst is uninitialized and holds
garbage.

Split read/write helper functions into two functions each, one for
single byte IO and one for multi-byte IO. Fix all call sites. Do not
change the program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c