Skip to content

Commit

Permalink
Verification: verify code changes from PR review
Browse files Browse the repository at this point in the history
	- verify code changes from PR review

Signed-off-by: McAtee Maxwell <[email protected]>
  • Loading branch information
mcatee-infineon committed Oct 7, 2024
1 parent 10e8bd2 commit 5d210c4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/rtc/rtc_ifx_cat1.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ struct ifx_cat1_rtc_config {

struct ifx_cat1_rtc_data {
struct k_spinlock lock;
bool valid_time_set;
};

static inline uint16_t _ifx_cat1_rtc_get_state(void)
Expand Down Expand Up @@ -156,9 +155,6 @@ void _ifx_cat1_rtc_century_interrupt(void)
static int ifx_cat1_rtc_init(const struct device *dev)
{
cy_rslt_t rslt = CY_RSLT_SUCCESS;
struct ifx_cat1_rtc_data *data = dev->data;

data->valid_time_set = false;

Cy_SysClk_ClkBakSetSource(CY_SYSCLK_BAK_IN_CLKLF);

Expand Down Expand Up @@ -241,8 +237,6 @@ static int ifx_cat1_rtc_set_time(const struct device *dev, const struct rtc_time

if (rslt == CY_RSLT_SUCCESS) {
_ifx_cat1_rtc_set_state(_IFX_CAT1_RTC_STATE_TIME_SET);
data->valid_time_set = true;

return 0;
} else {
return -EINVAL;
Expand All @@ -255,7 +249,7 @@ static int ifx_cat1_rtc_get_time(const struct device *dev, struct rtc_time *time

cy_stc_rtc_config_t dateTime = {.hrFormat = CY_RTC_24_HOURS};

if (false == data->valid_time_set) {
if (_ifx_cat1_rtc_get_state() != _IFX_CAT1_RTC_STATE_TIME_SET) {
LOG_ERR("Valid time has not been set with rtc_set_time yet");
return -ENODATA;
}
Expand Down

0 comments on commit 5d210c4

Please sign in to comment.