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

powerpc/8xx: Remove init_internal_rtc() to fix no previous prototype error

A W=1 build of mpc885_ads_defconfig throws the following error:

CC arch/powerpc/platforms/8xx/m8xx_setup.o
arch/powerpc/platforms/8xx/m8xx_setup.c:41:1: error: no previous prototype for 'init_internal_rtc' [-Werror=missing-prototypes]
41 | init_internal_rtc(void)
| ^~~~~~~~~~~~~~~~~

init_internal_rtc() was introduced by commit df34403dcaac ("[POWERPC]
8xx: Add mpc885ads support and common mpc8xx files") as a weak
function but has never been defined and/or used outside m8xx_setup.c

As it is called only once there, just fold it into its caller and
remove it.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/0aa1141e18a84d926e199093204b37ec993f0c87.1692275185.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
4531f128 eb5aa213

+5 -12
+5 -12
arch/powerpc/platforms/8xx/m8xx_setup.c
··· 36 36 return IRQ_HANDLED; 37 37 } 38 38 39 - /* per-board overridable init_internal_rtc() function. */ 40 - void __init __attribute__ ((weak)) 41 - init_internal_rtc(void) 42 - { 43 - /* Disable the RTC one second and alarm interrupts. */ 44 - clrbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE)); 45 - 46 - /* Enable the RTC */ 47 - setbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE)); 48 - } 49 - 50 39 static int __init get_freq(char *name, unsigned long *val) 51 40 { 52 41 struct device_node *cpu; ··· 106 117 out_be32(&mpc8xx_immr->im_sitk.sitk_rtcsck, KAPWR_KEY); 107 118 out_be32(&mpc8xx_immr->im_sitk.sitk_tbk, KAPWR_KEY); 108 119 109 - init_internal_rtc(); 120 + /* Disable the RTC one second and alarm interrupts. */ 121 + clrbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE)); 122 + 123 + /* Enable the RTC */ 124 + setbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE)); 110 125 111 126 /* Enabling the decrementer also enables the timebase interrupts 112 127 * (or from the other point of view, to get decrementer interrupts