Skip to content

Commit 76c5120

Browse files
Jan Nordholzevgeni
authored andcommitted
Adapt HDAPS driver to use the new timer_setup() interface.
Linux 4.15 removed the ancient init_timer() API and changed the signature of the timer handler function. Signed-off-by: Jan Nordholz <jnordholz@sec.t-labs.tu-berlin.de> Closes: #31
1 parent fc60d0d commit 76c5120

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

hdaps.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,11 @@ static void hdaps_calibrate(void)
469469
/* Timer handler for updating the input device. Runs in softirq context,
470470
* so avoid lenghty or blocking operations.
471471
*/
472+
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
472473
static void hdaps_mousedev_poll(unsigned long unused)
474+
#else
475+
static void hdaps_mousedev_poll(struct timer_list *unused)
476+
#endif
473477
{
474478
int ret;
475479

@@ -779,8 +783,12 @@ static int __init hdaps_init(void)
779783
hdaps_invert = 0; /* default */
780784

781785
/* Init timer before platform_driver_register, in case of suspend */
786+
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
782787
init_timer(&hdaps_timer);
783788
hdaps_timer.function = hdaps_mousedev_poll;
789+
#else
790+
timer_setup(&hdaps_timer, hdaps_mousedev_poll, 0);
791+
#endif
784792
ret = platform_driver_register(&hdaps_driver);
785793
if (ret)
786794
goto out;

0 commit comments

Comments
 (0)