Skip to content

Commit da1cd59

Browse files
dulibo1Alan Carvalho de Assis
authored andcommitted
regualtor:fix regulator_register check rpmsg regulator which leads to recursion
Signed-off-by: dulibo1 <[email protected]>
1 parent f0bc20c commit da1cd59

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/power/supply/regulator.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,6 @@ static FAR struct regulator_dev_s *regulator_dev_lookup(const char *supply)
217217
}
218218

219219
regulator_unlock(&g_reg_lock, flags);
220-
221-
#if defined(CONFIG_REGULATOR_RPMSG)
222-
if (rdev_found == NULL && strchr(supply, '/'))
223-
{
224-
rdev_found = regulator_rpmsg_get(supply);
225-
}
226-
#endif
227-
228220
return rdev_found;
229221
}
230222

@@ -569,6 +561,14 @@ FAR struct regulator_s *regulator_get(FAR const char *id)
569561
}
570562

571563
rdev = regulator_dev_lookup(id);
564+
565+
#if defined(CONFIG_REGULATOR_RPMSG)
566+
if (rdev == NULL && strchr(id, '/'))
567+
{
568+
rdev = regulator_rpmsg_get(id);
569+
}
570+
#endif
571+
572572
if (rdev == NULL)
573573
{
574574
pwrerr("regulator %s not found\n", id);

0 commit comments

Comments
 (0)