mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user