hevz / panasonic-hbtn

Panasonic CF-18/19 (Toughbook) Tablet Button driver for Linux
16 stars 16 forks source link

Migrate uses of sparse_keymap_free #5

Open xylo04 opened 4 years ago

xylo04 commented 4 years ago

This no longer compiles on modern systems because sparse_keymap_free has been removed.

chris@helmhorn:~/git/panasonic-hbtn$ make
make -C /lib/modules/5.0.0-36-generic/build M=/home/chris/git/panasonic-hbtn modules
make[1]: Entering directory '/usr/src/linux-headers-5.0.0-36-generic'
  CC [M]  /home/chris/git/panasonic-hbtn/panasonic-hbtn.o
/home/chris/git/panasonic-hbtn/panasonic-hbtn.c: In function ‘acpi_pcc_init_input’:
/home/chris/git/panasonic-hbtn/panasonic-hbtn.c:170:5: error: implicit declaration of function ‘sparse_keymap_free’; did you mean ‘sparse_keymap_setup’? [-Werror=implicit-function-declaration]
     sparse_keymap_free(input_dev);
     ^~~~~~~~~~~~~~~~~~
     sparse_keymap_setup
cc1: some warnings being treated as errors
scripts/Makefile.build:291: recipe for target '/home/chris/git/panasonic-hbtn/panasonic-hbtn.o' failed
make[2]: *** [/home/chris/git/panasonic-hbtn/panasonic-hbtn.o] Error 1
Makefile:1614: recipe for target '_module_/home/chris/git/panasonic-hbtn' failed
make[1]: *** [_module_/home/chris/git/panasonic-hbtn] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-36-generic'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
ghostshadow commented 4 years ago

yes, the sparse_keymap_free function has been removed without replacement, since it is no longer neccesary. (see comment and commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=79ffd5f98c11572c004d52f7ecd270ab680a7f72 ) For recent kernels it can be dropped, the only question is, if support for kernels before the memory management change is desired and how this would be implemented.

xylo04 commented 4 years ago

For recent kernels it can be dropped

Is that to say that we can simply remove any calls to sparse_keymap_free? I suppose we would ideally have compiler directives to keep the calls in when an older kernel is used, but for now I'd settle for getting my own laptop usable.

ghostshadow commented 4 years ago

@xylo04 yes, that's what I did to get it working for me (see my fork, which I used for now as the target for my Archlinux PKGBUILD ).