rtc: pcap: Initialize drvdata before registering device
rtc: pcap: Initialize drvdata before registering device

Commit f44f7f96a20 ("RTC: Initialize kernel state from RTC") uncovered
an issue in a number of RTC drivers, where the drivers call
rtc_device_register before initializing the device or platform drvdata.

This frequently results in null pointer dereferences when the
rtc_device_register immediately makes use of the rtc device, calling
rtc_read_alarm.

The solution is to ensure the drvdata is initialized prior to registering
the rtc device.

CC: Wolfram Sang <3883f8aab0424a154a3bcb43ff874b819786efbe@pengutronix.de>
CC: Alessandro Zummo <f0b9bd96bf07bfecc189c62159960134588fafe5@towertech.it>
CC: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
CC: 2c98ab252b0688038c565f7a1df1d99710e84d7a@googlegroups.com
Signed-off-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>

KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas