]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: smartpqi: fix time handling
authorArnd Bergmann <arnd@arndb.de>
Thu, 13 Jul 2017 19:51:46 +0000 (15:51 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 26 Jul 2017 04:06:48 +0000 (21:06 -0700)
commit89438f2b4f94c06c0afd810b11f88ce4fbfc0caf
treede2bbaa687194e7107013ff59e4d6cd5b827c01b
parentb347809061bbe94dcd39d38306139944ec2f57b8
scsi: smartpqi: fix time handling

Orabug: 2619102126447813

When we have turned off RTC support, the smartpqi driver fails to build:

ERROR: "rtc_time64_to_tm" [drivers/scsi/smartpqi/smartpqi.ko] undefined!

This is easily avoided by using the generic 'struct tm' based helper rather
than the RTC specific one. While fixing this, I noticed that even though
the driver uses time64_t for storing seconds, it gets them from the
old 32-bit struct timeval. To address this, we can simplify the code
by calling ktime_get_real_seconds() directly.

Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ed10858eadd4988260c6bc7d75fc25176342b5a7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/smartpqi/smartpqi_init.c