• Tobin C. Harding's avatar
    staging: ks7010: refactor SDIO read/write helpers · f1e79f4b
    Tobin C. Harding authored
    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: default avatarTobin C. Harding <me@tobin.cc>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f1e79f4b
ks7010_sdio.c 26.1 KB