]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
scsi: smartpqi: fix time handling
authorArnd Bergmann <arnd@arndb.de>
Fri, 17 Feb 2017 15:03:52 +0000 (16:03 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:46:37 +0000 (10:46 +0200)
commit8c3dbb0a52242daf9edd5d5fd4db5bce70aa3254
tree322ddeece64d1fb2ec2e565ec68ecaa240556d9e
parentaa7ec14fa36bb9989fa50e255fe61e946b77f0a3
scsi: smartpqi: fix time handling

BugLink: http://bugs.launchpad.net/bugs/1691369
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>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/scsi/smartpqi/smartpqi_init.c