Commit d30c8d20 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jacek Anaszewski

leds: ledtrig-activity: use ktime_get_boot_ns()

get_monotonic_boottime() is deprecated, so let's convert this to
the simpler ktime_get_boot_ns().
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
parent ce397d21
...@@ -37,7 +37,6 @@ static void led_activity_function(struct timer_list *t) ...@@ -37,7 +37,6 @@ static void led_activity_function(struct timer_list *t)
struct activity_data *activity_data = from_timer(activity_data, t, struct activity_data *activity_data = from_timer(activity_data, t,
timer); timer);
struct led_classdev *led_cdev = activity_data->led_cdev; struct led_classdev *led_cdev = activity_data->led_cdev;
struct timespec boot_time;
unsigned int target; unsigned int target;
unsigned int usage; unsigned int usage;
int delay; int delay;
...@@ -57,8 +56,6 @@ static void led_activity_function(struct timer_list *t) ...@@ -57,8 +56,6 @@ static void led_activity_function(struct timer_list *t)
return; return;
} }
get_monotonic_boottime(&boot_time);
cpus = 0; cpus = 0;
curr_used = 0; curr_used = 0;
...@@ -76,7 +73,7 @@ static void led_activity_function(struct timer_list *t) ...@@ -76,7 +73,7 @@ static void led_activity_function(struct timer_list *t)
* down to 16us, ensuring we won't overflow 32-bit computations below * down to 16us, ensuring we won't overflow 32-bit computations below
* even up to 3k CPUs, while keeping divides cheap on smaller systems. * even up to 3k CPUs, while keeping divides cheap on smaller systems.
*/ */
curr_boot = timespec_to_ns(&boot_time) * cpus; curr_boot = ktime_get_boot_ns() * cpus;
diff_boot = (curr_boot - activity_data->last_boot) >> 16; diff_boot = (curr_boot - activity_data->last_boot) >> 16;
diff_used = (curr_used - activity_data->last_used) >> 16; diff_used = (curr_used - activity_data->last_used) >> 16;
activity_data->last_boot = curr_boot; activity_data->last_boot = curr_boot;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment