mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
ANDROID: rtc: class: support hctosys from modular RTC drivers
In order to support setting the system time from modular RTC drivers via the hctosys mechanism, check at the end of RTC device registration for whether the time should be synced, rather than once at late init. Bug: 144103362 Bug: 143046457 Change-Id: I65d2fd14e075a65f2a23e1268b02c907c5245fb8 Signed-off-by: Steve Muckle <smuckle@google.com>
This commit is contained in:
parent
81c818c2f5
commit
5f378fd56a
3 changed files with 10 additions and 3 deletions
|
|
@ -375,6 +375,11 @@ int __rtc_register_device(struct module *owner, struct rtc_device *rtc)
|
|||
dev_info(rtc->dev.parent, "registered as %s\n",
|
||||
dev_name(&rtc->dev));
|
||||
|
||||
#ifdef CONFIG_RTC_HCTOSYS_DEVICE
|
||||
if (!strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE))
|
||||
rtc_hctosys();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__rtc_register_device);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
* the best guess is to add 0.5s.
|
||||
*/
|
||||
|
||||
static int __init rtc_hctosys(void)
|
||||
int rtc_hctosys(void)
|
||||
{
|
||||
int err = -ENODEV;
|
||||
struct rtc_time tm;
|
||||
|
|
@ -65,5 +65,3 @@ err_open:
|
|||
|
||||
return err;
|
||||
}
|
||||
|
||||
late_initcall(rtc_hctosys);
|
||||
|
|
|
|||
|
|
@ -46,3 +46,7 @@ static inline const struct attribute_group **rtc_get_dev_attribute_groups(void)
|
|||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTC_HCTOSYS
|
||||
extern int rtc_hctosys(void);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue