linuxppc / issues

Issues repository for linuxppc
5 stars 0 forks source link

Further clean up powerpc RTC drivers as per Arnd #47

Open mpe opened 8 years ago

mpe commented 8 years ago

See https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-May/142705.html

Just for reference, if anyone ever wants to clean this up further on powerpc to remove all of the rtc handling from architecture code, it has gotten easier after my series:

  • The update_persistent_clock() and read_persistent_clock() callbacks are now unnecessary: as long as the RTC driver is built into the kernel, drivers/rtc/hctosys.c takes care of setting the initial time (otherwise user space has to do it), and the other users (ntp and suspend/resume) will work fine whenever an rtc driver is loaded. Obviously you will want to test the kernel better after removing the two functions.
  • Once they are gone, the only users of the ppc_md.{get,set}_rtc_time callbacks are in the "const struct rtc_class_ops rtc_generic_ops". You can move them into the five files implementing those callbacks and call the functions directly to get rid of the function pointers.
  • Lastly, after that is done, you basically have five independent rtc device drivers that can get moved to drivers/rtc and converted into regular platform drivers. Instead of registering the fake "rtc-generic" device, you then register the one that is actually there like arch/powerpc/sysdev/rtc_cmos_setup.c already does, or use the one that gets created from DT.
deece commented 5 years ago

Still relevant