Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powernv: Remove get/set_rtc_time when they are not present

Currently we continue to poll get/set_rtc_time even when we know they
are not working.

This changes it so that if it fails at boot time we remove the ppc_md
get/set_rtc_time hooks so that we don't end up polling known broken
calls.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Michael Neuling and committed by
Benjamin Herrenschmidt
2c49195b 0150a3dd

+5 -1
+5 -1
arch/powerpc/platforms/powernv/opal-rtc.c
··· 18 18 19 19 #include <asm/opal.h> 20 20 #include <asm/firmware.h> 21 + #include <asm/machdep.h> 21 22 22 23 static void opal_to_tm(u32 y_m_d, u64 h_m_s_ms, struct rtc_time *tm) 23 24 { ··· 49 48 else 50 49 mdelay(10); 51 50 } 52 - if (rc != OPAL_SUCCESS) 51 + if (rc != OPAL_SUCCESS) { 52 + ppc_md.get_rtc_time = NULL; 53 + ppc_md.set_rtc_time = NULL; 53 54 return 0; 55 + } 54 56 y_m_d = be32_to_cpu(__y_m_d); 55 57 h_m_s_ms = be64_to_cpu(__h_m_s_ms); 56 58 opal_to_tm(y_m_d, h_m_s_ms, &tm);