Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

device-generic-common: Commit

device/generic/common


Commit MetaInfo

Revisione07d8139c890f6cfb8b1eba0bf7a7f258c9e1d38 (tree)
Time2018-12-07 17:47:54
AuthorMauro Rossi <issor.oruam@gmai...>
CommiterChih-Wei Huang

Log Message

tp_smapi/hdaps: use timer_setup() with kernel 4.15 and later

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

Change Summary

Incremental Difference

--- a/tp_smapi/hdaps.c
+++ b/tp_smapi/hdaps.c
@@ -779,8 +779,12 @@ static int __init hdaps_init(void)
779779 hdaps_invert = 0; /* default */
780780
781781 /* 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
782785 init_timer(&hdaps_timer);
783786 hdaps_timer.function = hdaps_mousedev_poll;
787+#endif
784788 ret = platform_driver_register(&hdaps_driver);
785789 if (ret)
786790 goto out;
Show on old repository browser