header: timekeeping.h: Add ktime_get_real_seconds()
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 4 Mar 2018 22:57:12 +0000 (23:57 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 21 Mar 2018 08:19:32 +0000 (09:19 +0100)
This function was added in commit dbe7aa622db96b ("timekeeping: Provide
y2038 safe accessor to the seconds portion of CLOCK_REALTIME") and is
used by multiple realtek drivers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/linux/timekeeping.h

index 0b9c649a3395b32b793f46455d026eb59670ad66..c108645fd58f169b440bfc83890eb36de4587817 100644 (file)
@@ -33,6 +33,15 @@ static inline time64_t ktime_get_seconds(void)
 
        return t.tv_sec;
 }
+
+static inline time64_t ktime_get_real_seconds(void)
+{
+       struct timeval tv;
+
+       do_gettimeofday(&tv);
+
+       return tv.tv_sec;
+}
 #endif
 
 #endif /* __BACKPORT_TIMEKEEPING_H */