leds: ledtrig-activity: use ktime_get_boot_ns()
authorArnd Bergmann <arnd@arndb.de>
Tue, 19 Jun 2018 08:18:56 +0000 (10:18 +0200)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Tue, 19 Jun 2018 20:38:29 +0000 (22:38 +0200)
get_monotonic_boottime() is deprecated, so let's convert this to
the simpler ktime_get_boot_ns().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/trigger/ledtrig-activity.c

index 5081894082bd621aed5af7843aadd10536830ef4..6c6f8a9b8d9a3a41c70f53011fd8ca3cd8c60328 100644 (file)
@@ -37,7 +37,6 @@ static void led_activity_function(struct timer_list *t)
        struct activity_data *activity_data = from_timer(activity_data, t,
                                                         timer);
        struct led_classdev *led_cdev = activity_data->led_cdev;
-       struct timespec boot_time;
        unsigned int target;
        unsigned int usage;
        int delay;
@@ -57,8 +56,6 @@ static void led_activity_function(struct timer_list *t)
                return;
        }
 
-       get_monotonic_boottime(&boot_time);
-
        cpus = 0;
        curr_used = 0;
 
@@ -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
         * 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_used = (curr_used - activity_data->last_used) >> 16;
        activity_data->last_boot = curr_boot;