From 957952b82f1e129e5d28fc0f99b3a25520004ee5 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 21 Feb 2025 12:19:03 +0100 Subject: [PATCH 1/2] drivers: charger: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/charger/charger_pf1550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/charger/charger_pf1550.c b/drivers/charger/charger_pf1550.c index 06ce4d3bc5c91..e53785a629879 100644 --- a/drivers/charger/charger_pf1550.c +++ b/drivers/charger/charger_pf1550.c @@ -660,7 +660,7 @@ static int pf1550_init(const struct device *dev) return 0; } -static const struct charger_driver_api pf1550_driver_api = { +static DEVICE_API(charger, pf1550_driver_api) = { .get_property = pf1550_get_prop, .set_property = pf1550_set_prop, .charge_enable = pf1550_set_enabled, From cf0ed58f21902118f5fea64f7e4cb99046b31214 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 21 Feb 2025 12:20:00 +0100 Subject: [PATCH 2/2] drivers: regulator: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/regulator/regulator_pf1550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/regulator_pf1550.c b/drivers/regulator/regulator_pf1550.c index 3759e8e912397..7cbfd0cd7713d 100644 --- a/drivers/regulator/regulator_pf1550.c +++ b/drivers/regulator/regulator_pf1550.c @@ -378,11 +378,11 @@ static int regulator_pf1550_common_init(const struct device *dev) return 0; } -static const struct regulator_parent_driver_api parent_api = { +static DEVICE_API(regulator_parent, parent_api) = { .ship_mode = regulator_pf1550_power_off, }; -static const struct regulator_driver_api api = { +static DEVICE_API(regulator, api) = { .enable = regulator_pf1550_enable, .disable = regulator_pf1550_disable, .count_voltages = regulator_pf1550_count_voltages,