@@ -18,19 +18,17 @@
#include "rtc-core.h"
-#define NAME_SIZE 10
-
#if defined(CONFIG_RTC_HCTOSYS_DEVICE)
static bool is_rtc_hctosys(struct rtc_device *rtc)
{
int size;
- char name[NAME_SIZE];
+ char name[RTC_HCTOSYS_DEVICE_SIZE];
- size = scnprintf(name, NAME_SIZE, "rtc%d", rtc->id);
- if (size > NAME_SIZE)
+ size = scnprintf(name, RTC_HCTOSYS_DEVICE_SIZE, "rtc%d", rtc->id);
+ if (size > RTC_HCTOSYS_DEVICE_SIZE)
return false;
- return !strncmp(name, CONFIG_RTC_HCTOSYS_DEVICE, NAME_SIZE);
+ return !strncmp(name, rtc_hctosys_device, RTC_HCTOSYS_DEVICE_SIZE);
}
#else
static bool is_rtc_hctosys(struct rtc_device *rtc)
@@ -192,6 +192,7 @@ static inline bool is_leap_year(unsigned int year)
}
#ifdef CONFIG_RTC_HCTOSYS_DEVICE
+#define RTC_HCTOSYS_DEVICE_SIZE 10
extern int rtc_hctosys_ret;
#else
#define rtc_hctosys_ret -ENODEV