Fixes the following building error happening with kernel 4.15:
CC [M] .../out/target/product/x86/obj/kmodule/tp_smapi/hdaps.o
.../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]
init_timer(&hdaps_timer);
^
.../out/target/product/x86/obj/kmodule/tp_smapi/hdaps.c:783:23:
warning: assignment from incompatible pointer type
hdaps_timer.function = hdaps_mousedev_poll;
^
cc1: some warnings being treated as errors
hdaps_invert = 0; /* default */
/* Init timer before platform_driver_register, in case of suspend */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+ timer_setup(&hdaps_timer, hdaps_mousedev_poll, 0);
+#else
init_timer(&hdaps_timer);
hdaps_timer.function = hdaps_mousedev_poll;
+#endif
ret = platform_driver_register(&hdaps_driver);
if (ret)
goto out;