|
@@ -142,6 +142,16 @@ static int opal_get_tpo_time(struct device *dev, struct rtc_wkalrm *alarm)
|
|
|
|
|
|
y_m_d = be32_to_cpu(__y_m_d);
|
|
y_m_d = be32_to_cpu(__y_m_d);
|
|
h_m_s_ms = ((u64)be32_to_cpu(__h_m) << 32);
|
|
h_m_s_ms = ((u64)be32_to_cpu(__h_m) << 32);
|
|
|
|
+
|
|
|
|
+ /* check if no alarm is set */
|
|
|
|
+ if (y_m_d == 0 && h_m_s_ms == 0) {
|
|
|
|
+ pr_debug("No alarm is set\n");
|
|
|
|
+ rc = -ENOENT;
|
|
|
|
+ goto exit;
|
|
|
|
+ } else {
|
|
|
|
+ pr_debug("Alarm set to %x %llx\n", y_m_d, h_m_s_ms);
|
|
|
|
+ }
|
|
|
|
+
|
|
opal_to_tm(y_m_d, h_m_s_ms, &alarm->time);
|
|
opal_to_tm(y_m_d, h_m_s_ms, &alarm->time);
|
|
|
|
|
|
exit:
|
|
exit:
|