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:
parent
ffcd08205c
commit
d07c4545ec
@ -7438,7 +7438,7 @@ static int _dahdi_register_device(struct dahdi_device *ddev,
|
||||
__dahdi_init_span(s);
|
||||
}
|
||||
|
||||
ktime_get_ts(&ddev->registration_time);
|
||||
ddev->registration_time = ktime_get();
|
||||
ret = dahdi_sysfs_add_device(ddev, parent);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -654,10 +654,11 @@ dahdi_registration_time_show(struct device *dev,
|
||||
{
|
||||
struct dahdi_device *ddev = to_ddev(dev);
|
||||
int count = 0;
|
||||
struct timespec64 ts = ktime_to_timespec64(ddev->registration_time);
|
||||
|
||||
count += sprintf(buf, "%010ld.%09ld\n",
|
||||
ddev->registration_time.tv_sec,
|
||||
ddev->registration_time.tv_nsec);
|
||||
count += sprintf(buf, "%010lld.%09ld\n",
|
||||
(s64)ts.tv_sec,
|
||||
ts.tv_nsec);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
@ -907,7 +907,7 @@ struct dahdi_device {
|
||||
const char *devicetype;
|
||||
struct device dev;
|
||||
unsigned int irqmisses;
|
||||
struct timespec registration_time;
|
||||
ktime_t registration_time;
|
||||
};
|
||||
|
||||
struct dahdi_span {
|
||||
|
Loading…
Reference in New Issue
Block a user