Skip to content

Commit d596afc

Browse files
pdgendtfabiobaltieri
authored andcommitted
drivers: regulator: Place API in iterable section
Add wrapper DEVICE_API macro to all regulator_driver_api instances. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent d0d8158 commit d596afc

15 files changed

+23
-21
lines changed

drivers/regulator/regulator_adp5360.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int regulator_adp5360_init(const struct device *dev)
268268
return regulator_common_init(dev, (val & ADP5360_BUCK_CFG_EN_MSK) != 0U);
269269
}
270270

271-
static const struct regulator_driver_api api = {
271+
static DEVICE_API(regulator, api) = {
272272
.enable = regulator_adp5360_enable,
273273
.disable = regulator_adp5360_disable,
274274
.count_voltages = regulator_adp5360_count_voltages,

drivers/regulator/regulator_axp192.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static int axp192_get_current_limit(const struct device *dev, int32_t *curr_ua)
329329
return 0;
330330
}
331331

332-
static struct regulator_driver_api api = {
332+
static DEVICE_API(regulator, api) = {
333333
.enable = axp192_enable,
334334
.disable = axp192_disable,
335335
.count_voltages = axp192_count_voltages,

drivers/regulator/regulator_cp9314.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ static int regulator_cp9314_init(const struct device *dev)
686686
return regulator_common_init(dev, false);
687687
}
688688

689-
static const struct regulator_driver_api api = {
689+
static DEVICE_API(regulator, api) = {
690690
.enable = regulator_cp9314_enable,
691691
.disable = regulator_cp9314_disable,
692692
.get_error_flags = regulator_cp9314_get_error_flags,

drivers/regulator/regulator_da1469x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ static int regulator_da1469x_get_current_limit(const struct device *dev,
383383
return ret;
384384
}
385385

386-
static const struct regulator_driver_api regulator_da1469x_api = {
386+
static DEVICE_API(regulator, regulator_da1469x_api) = {
387387
.enable = regulator_da1469x_enable,
388388
.disable = regulator_da1469x_disable,
389389
.count_voltages = regulator_da1469x_count_voltages,

drivers/regulator/regulator_fake.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ DEFINE_FAKE_VALUE_FUNC(int, regulator_fake_get_active_discharge, const struct de
4747
DEFINE_FAKE_VALUE_FUNC(int, regulator_fake_get_error_flags,
4848
const struct device *, regulator_error_flags_t *);
4949

50-
static struct regulator_driver_api api = {
50+
static DEVICE_API(regulator, api) = {
5151
.enable = regulator_fake_enable,
5252
.disable = regulator_fake_disable,
5353
.count_voltages = regulator_fake_count_voltages,

drivers/regulator/regulator_fixed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int regulator_fixed_list_voltage(const struct device *dev,
7474
return 0;
7575
}
7676

77-
static const struct regulator_driver_api regulator_fixed_api = {
77+
static DEVICE_API(regulator, regulator_fixed_api) = {
7878
.enable = regulator_fixed_enable,
7979
.disable = regulator_fixed_disable,
8080
.count_voltages = regulator_fixed_count_voltages,

drivers/regulator/regulator_gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static int regulator_gpio_get_voltage(const struct device *dev, int32_t *volt_uv
150150
return 0;
151151
}
152152

153-
static const struct regulator_driver_api regulator_gpio_api = {
153+
static DEVICE_API(regulator, regulator_gpio_api) = {
154154
.enable = regulator_gpio_enable,
155155
.disable = regulator_gpio_disable,
156156
.set_voltage = regulator_gpio_set_voltage,

drivers/regulator/regulator_max20335.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static const struct regulator_parent_driver_api parent_api = {
325325
.ship_mode = regulator_max20335_power_off,
326326
};
327327

328-
static const struct regulator_driver_api api = {
328+
static DEVICE_API(regulator, api) = {
329329
.enable = regulator_max20335_enable,
330330
.disable = regulator_max20335_disable,
331331
.set_mode = regulator_max20335_set_mode,

drivers/regulator/regulator_mpm54304.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int regulator_mpm54304_init(const struct device *dev)
6464
return 0;
6565
}
6666

67-
static const struct regulator_driver_api mpm54304_api = {
67+
static DEVICE_API(regulator, mpm54304_api) = {
6868
.enable = regulator_mpm54304_enable,
6969
.disable = regulator_mpm54304_disable,
7070
};

drivers/regulator/regulator_npm1100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static int regulator_npm1100_common_init(const struct device *dev)
101101
return 0;
102102
}
103103

104-
static const __unused struct regulator_driver_api api = {
104+
static DEVICE_API(regulator, api) __unused = {
105105
.set_mode = regulator_npm1100_set_mode,
106106
.get_mode = regulator_npm1100_get_mode,
107107
};

0 commit comments

Comments
 (0)