• Arnd Bergmann's avatar
    staging: wilc1000: revert "fix TODO to compile spi and sdio components in single module" · f45b8934
    Arnd Bergmann authored
    The TODO item named "make spi and sdio components coexist in one build"
    was apparently addressed a long time ago, but never removed from the
    TODO file. However, the new patch that tries to address it actually
    makes it worse again by duplicating the common parts of the driver into
    two separate modules rather than sharing them. This also introduces a
    build regression when one of the two is built-in while the other is a
    loadable module:
    
    drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined reference to `__this_module'
    
    Reverting the patch makes it build again. I'm leaving the TODO file
    modification though, as there is nothing left to do for this item.
    
    A related problem however still seems to exist: one still cannot have
    multiple concurrent instances of wilc1000 devices present in the
    system, as there are lots of shared global variables such as
    
    host_interface.c:static struct wilc_vif *periodic_rssi_vif;
    wilc_sdio.c:static struct wilc_sdio g_sdio;
    wilc_wlan.c:static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;
    wilc_wlan.c:static u32 pending_acks;
    wilc_wfi_cfgoperations.c:int wilc_connecting;
    
    In order to have multiple instances working (sdio, spi, or mixed),
    all such variables need to be dynamically allocated per instance and
    stored in 'struct wilc' or one of the structures referenced by it.
    
    Fixes: 9abc44ba ("staging: wilc1000: fix TODO to compile spi and sdio components in single module")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f45b8934
wilc_debugfs.c 2.41 KB