scsi: smartpqi: fix time handling
commit2523b0855c42245b715d0e913fea8f8e5af3c6d1
authorArnd Bergmann <arnd@arndb.de>
Fri, 17 Feb 2017 15:03:52 +0000 (17 16:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 May 2017 12:08:27 +0000 (14 14:08 +0200)
tree7a9745f657e1570bc8d0878621a9d3faa7eef0ef
parenta538d5f72454fb4c76a5dc74d732268cb4b2cffd
scsi: smartpqi: fix time handling

commit ed10858eadd4988260c6bc7d75fc25176342b5a7 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/smartpqi/smartpqi_init.c