regulator:check id conflict when register
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
This commit is contained in:
parent
57d9083844
commit
127bd81674
@ -964,6 +964,12 @@ regulator_register(FAR const struct regulator_desc_s *regulator_desc,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (regulator_dev_lookup(regulator_desc->name))
|
||||
{
|
||||
pwrerr("regulator name is registered\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (regulator_ops->get_voltage && regulator_ops->get_voltage_sel)
|
||||
{
|
||||
pwrerr("get_voltage and get_voltage_sel are both assigned\n");
|
||||
|
Loading…
Reference in New Issue
Block a user