Skip to content
  • Gwenhael Goavec-Merou's avatar
    kernel: wr_nic: endpoint: use timer_setup instead of setup_timer with kernel > 4.15 · aa8d5d99
    Gwenhael Goavec-Merou authored and Juan David González Cobas's avatar Juan David González Cobas committed
    
    
    Since kernel 4.15, setup_timer is no more available and compilation fails with :
    make -C kernel
    make[1]: Entering directory '/.../wr-starting-kit/spec-sw/kernel'
    make -C /lib/modules/4.18.0-1-amd64/build M=/.../wr-starting-kit/spec-sw/kernel FMC_BUS_ABS=/.../wr-starting-kit/spec-sw/fmc-bus modules
    make[2]: Entering directory '/usr/src/linux-headers-4.18.0-1-amd64'
      CC [M]  /.../wr-starting-kit/spec-sw/kernel/wr_nic/endpoint.o
    /.../wr-starting-kit/spec-sw/kernel/wr_nic/endpoint.c: In function 'wrn_ep_open':
    /.../wr-starting-kit/spec-sw/kernel/wr_nic/endpoint.c:193:2: error: implicit declaration of function 'setup_timer'; did you mean 'del_timer'? [-Werror=implicit-function-declaration]
      setup_timer(&ep->ep_link_timer, wrn_ep_check_link, timerarg);
      ^~~~~~~~~~~
      del_timer
    cc1: some warnings being treated as errors
    make[5]: *** [/usr/src/linux-headers-4.18.0-1-common/scripts/Makefile.build:323: /.../wr-starting-kit/spec-sw/kernel/wr_nic/endpoint.o] Error 1
    make[4]: *** [/usr/src/linux-headers-4.18.0-1-common/Makefile:1518: _module_/.../wr-starting-kit/spec-sw/kernel] Error 2
    make[3]: *** [Makefile:146: sub-make] Error 2
    make[2]: *** [Makefile:8: all] Error 2
    make[2]: Leaving directory '/usr/src/linux-headers-4.18.0-1-amd64'
    make[1]: *** [Makefile:20: all] Error 2
    make[1]: Leaving directory '/.../wr-starting-kit/spec-sw/kernel'
    make: *** [Makefile:28: kernel] Error 2
    
    This patch add preprocessor case to detect kernel version.
    For kernel > 4.15 timer_setup is use instead of setup_timer and callback is
    adapted to the new need.
    
    Signed-off-by: default avatarGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
    aa8d5d99