regualtor: use regulator_enable in idle task may casue assert

if regulator_get the supply which call kmm_zalloc

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
dulibo1
2023-10-13 11:33:32 +08:00
committed by Xiang Xiao
parent f53ae757b8
commit 15833a3cbd
+11 -1
View File
@@ -590,11 +590,21 @@ FAR struct regulator_s *regulator_get(FAR const char *id)
}
#endif
if (rdev && rdev->desc->supply_name && rdev->supply == NULL)
{
rdev->supply = regulator_get(rdev->desc->supply_name);
if (rdev->supply == NULL)
{
pwrerr("get supply %s failed \n", rdev->desc->supply_name);
rdev = NULL;
}
}
regulator_list_unlock(flags);
if (rdev == NULL)
{
pwrerr("regulator %s not found\n", id);
pwrerr("regulator %s not found or ready\n", id);
return NULL;
}