drivers: regulator: convert to dt device defines

Use the devicetree node as the source of object name and other
information used when defining the device structure.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-10-29 10:26:56 -05:00 committed by Anas Nashif
commit d9e45b579a

View file

@ -386,10 +386,9 @@ static const struct driver_config regulator_##id##_cfg = { \
\
static struct REG_DATA_TAG(id) regulator_##id##_data; \
\
DEVICE_AND_API_INIT(regulator_##id, DT_INST_LABEL(id), \
REG_INIT(id), \
&regulator_##id##_data, &regulator_##id##_cfg, \
POST_KERNEL, CONFIG_REGULATOR_FIXED_INIT_PRIORITY, \
&REG_API(id));
DEVICE_DT_DEFINE(DT_DRV_INST(id), REG_INIT(id), device_pm_control_nop, \
&regulator_##id##_data, &regulator_##id##_cfg, \
POST_KERNEL, CONFIG_REGULATOR_FIXED_INIT_PRIORITY, \
&REG_API(id));
DT_INST_FOREACH_STATUS_OKAY(REGULATOR_DEVICE)