--- dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/dahdi-sysfs.c 2019-10-03 21:48:09.000000000 +0700 +++ dahdi-linux-complete/linux/drivers/dahdi/dahdi-sysfs.c 2020-08-17 19:26:34.186150611 +0700 @@ -654,7 +654,15 @@ { struct dahdi_device *ddev = to_ddev(dev); int count = 0; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) struct timespec64 ts = ktime_to_timespec64(ddev->registration_time); +#else + /* ktime_to_timespec64 was added to Linux 3.17. + Moreover, ktime could be scalar, or "optimized". See CONFIG_KTIME_SCALAR. + Sure, untill 2038 DAHDI will remove support for kernels older than 3.17, + so, let's just use old ktime_to_timespec for old kernels. */ + struct timespec ts = ktime_to_timespec(ddev->registration_time); +#endif count += sprintf(buf, "%010lld.%09ld\n", (s64)ts.tv_sec,