dahdi: Store the span registration time as a ktime_t value as well.

Ideally we want to standardize on storing all timestamps derivied from the
system clock as ktime_t values.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This commit is contained in:
Shaun Ruffell 2019-03-28 22:43:53 -05:00
parent ffcd08205c
commit d07c4545ec
3 changed files with 6 additions and 5 deletions

View File

@ -7438,7 +7438,7 @@ static int _dahdi_register_device(struct dahdi_device *ddev,
__dahdi_init_span(s); __dahdi_init_span(s);
} }
ktime_get_ts(&ddev->registration_time); ddev->registration_time = ktime_get();
ret = dahdi_sysfs_add_device(ddev, parent); ret = dahdi_sysfs_add_device(ddev, parent);
if (ret) if (ret)
return ret; return ret;

View File

@ -654,10 +654,11 @@ dahdi_registration_time_show(struct device *dev,
{ {
struct dahdi_device *ddev = to_ddev(dev); struct dahdi_device *ddev = to_ddev(dev);
int count = 0; int count = 0;
struct timespec64 ts = ktime_to_timespec64(ddev->registration_time);
count += sprintf(buf, "%010ld.%09ld\n", count += sprintf(buf, "%010lld.%09ld\n",
ddev->registration_time.tv_sec, (s64)ts.tv_sec,
ddev->registration_time.tv_nsec); ts.tv_nsec);
return count; return count;
} }

View File

@ -907,7 +907,7 @@ struct dahdi_device {
const char *devicetype; const char *devicetype;
struct device dev; struct device dev;
unsigned int irqmisses; unsigned int irqmisses;
struct timespec registration_time; ktime_t registration_time;
}; };
struct dahdi_span { struct dahdi_span {