• Andrey Yurovsky's avatar
    libertas: correct card cleanup order in SPI driver · efcfd1f2
    Andrey Yurovsky authored
    The SPI driver does a couple of card cleanup steps in the wrong order on
    module removal.  If IEEE PS is enabled, this results in the card being
    left in IEEE PS mode and subsequent failures to reload the module.  The
    problem is that the surpriseremoved flag is set before calling
    lbs_remove_card, but that function needs to issue a command to exit IEEE
    PS mode (the flag blocks the command path).  In addition, lbs_stop_card
    should be called first because it clears out any pending commands.
    
    Tested on a GSPI device with V9 firmware by confirming that we can
    reload the module with or without IEEE PS enabled.
    
    Also fix a warning from the wrong uint format in a printk.
    
    V2: use z modifier, thanks Sebastian.
    Signed-off-by: default avatarAndrey Yurovsky <andrey@cozybit.com>
    Acked-by: default avatarDan Williams <dcbw@redhat.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    efcfd1f2
if_spi.c 30.8 KB