• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

device/generic/common


Commit MetaInfo

修訂e07d8139c890f6cfb8b1eba0bf7a7f258c9e1d38 (tree)
時間2018-12-07 17:47:54
作者Mauro 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

差異

--- 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;