device/generic/common
Revision | e0854547dfc34d9ce1348eff447cc950b9f8a4cb (tree) |
---|---|
Time | 2018-02-23 12:45:59 |
Author | Mauro Rossi <issor.oruam@gmai...> |
Commiter | Chih-Wei Huang |
tp_smapi/hdaps: use timer_setup() with kernel 4.15 and later
Fixes the following building error happening with kernel 4.15:
.../out/target/product/x86/obj/kmodule/tp_smapi/hdaps.c: In function 'hdaps_init':
.../out/target/product/x86/obj/kmodule/tp_smapi/hdaps.c:782:2:
error: implicit declaration of function 'init_timer' [-Werror=implicit-function-declaration]
.../out/target/product/x86/obj/kmodule/tp_smapi/hdaps.c:783:23:
warning: assignment from incompatible pointer type
cc1: some warnings being treated as errors
@@ -779,8 +779,12 @@ static int __init hdaps_init(void) | ||
779 | 779 | hdaps_invert = 0; /* default */ |
780 | 780 | |
781 | 781 | /* Init timer before platform_driver_register, in case of suspend */ |
782 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) | |
783 | + timer_setup(&hdaps_timer, hdaps_mousedev_poll, 0); | |
784 | +#else | |
782 | 785 | init_timer(&hdaps_timer); |
783 | 786 | hdaps_timer.function = hdaps_mousedev_poll; |
787 | +#endif | |
784 | 788 | ret = platform_driver_register(&hdaps_driver); |
785 | 789 | if (ret) |
786 | 790 | goto out; |