rtc/dw: convert to use DEVICE_AND_API_INIT()
Change-Id: I64b0a2d926813654318b289b2d8491deb107e94d Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
2898e249da
commit
6a8681a8d4
1 changed files with 5 additions and 6 deletions
|
@ -181,7 +181,7 @@ static uint32_t rtc_dw_read(struct device *dev)
|
|||
return sys_read32(rtc_dev->base_address + RTC_CCVR);
|
||||
}
|
||||
|
||||
static struct rtc_driver_api funcs = {
|
||||
static struct rtc_driver_api api_funcs = {
|
||||
.set_config = rtc_dw_set_config,
|
||||
.read = rtc_dw_read,
|
||||
.enable = rtc_dw_enable,
|
||||
|
@ -200,9 +200,10 @@ struct rtc_dw_dev_config rtc_dev = {
|
|||
#endif
|
||||
};
|
||||
|
||||
DEVICE_INIT(rtc, CONFIG_RTC_DRV_NAME, &rtc_dw_init,
|
||||
DEVICE_AND_API_INIT(rtc, CONFIG_RTC_DRV_NAME, &rtc_dw_init,
|
||||
&rtc_runtime, &rtc_dev,
|
||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&api_funcs);
|
||||
|
||||
int rtc_dw_init(struct device *dev)
|
||||
{
|
||||
|
@ -214,8 +215,6 @@ int rtc_dw_init(struct device *dev)
|
|||
|
||||
_rtc_dw_clock_config(dev);
|
||||
|
||||
dev->driver_api = &funcs;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue