Skip to content

Commit 6416928

Browse files
committed
nmasic: limit retries in chip_apply_conf()
1 parent 05c8316 commit 6416928

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/driver/source/nmasic.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
sint8 chip_apply_conf(uint32 u32Conf)
6666
{
6767
sint8 ret = M2M_SUCCESS;
68+
uint16 retries = TIMEOUT;
6869
uint32 val32 = u32Conf;
6970

7071
#if (defined __ENABLE_PMU__) || (defined CONF_WINC_INT_PMU)
@@ -98,9 +99,9 @@ sint8 chip_apply_conf(uint32 u32Conf)
9899
} else {
99100
break;
100101
}
101-
} while(1);
102+
} while(--retries);
102103

103-
return M2M_SUCCESS;
104+
return retries ? M2M_SUCCESS : M2M_ERR_TIME_OUT;
104105
}
105106
void chip_idle(void)
106107
{

0 commit comments

Comments
 (0)