From 3c0cdd14d8c07ed60bc1cec8607736690863b996 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Thu, 28 Nov 2024 20:28:36 +0100 Subject: [PATCH] drivers: usb_c: tcpc: Place API into iterable section Add wrapper DEVICE_API macro to all tcpc_driver_api instances. Signed-off-by: Pieter De Gendt --- drivers/usb_c/tcpc/ps8xxx.c | 2 +- drivers/usb_c/tcpc/ucpd_numaker.c | 2 +- drivers/usb_c/tcpc/ucpd_stm32.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb_c/tcpc/ps8xxx.c b/drivers/usb_c/tcpc/ps8xxx.c index 933764865e6..70c1d229860 100644 --- a/drivers/usb_c/tcpc/ps8xxx.c +++ b/drivers/usb_c/tcpc/ps8xxx.c @@ -543,7 +543,7 @@ int ps8xxx_tcpc_set_alert_handler_cb(const struct device *dev, tcpc_alert_handle /* Functions not assigned to the driver API but used by device */ -static const struct tcpc_driver_api ps8xxx_driver_api = { +static DEVICE_API(tcpc, ps8xxx_driver_api) = { .init = ps8xxx_tcpc_init, .get_cc = ps8xxx_tcpc_get_cc, .select_rp_value = ps8xxx_tcpc_select_rp_value, diff --git a/drivers/usb_c/tcpc/ucpd_numaker.c b/drivers/usb_c/tcpc/ucpd_numaker.c index c628b8604df..55daf4e9c5c 100644 --- a/drivers/usb_c/tcpc/ucpd_numaker.c +++ b/drivers/usb_c/tcpc/ucpd_numaker.c @@ -2304,7 +2304,7 @@ int numaker_tcpc_vbus_enable(const struct device *dev, bool enable) /* End of "*_tcpc_vbus_*" functions */ -static const struct tcpc_driver_api numaker_tcpc_driver_api = { +static DEVICE_API(tcpc, numaker_tcpc_driver_api) = { .init = numaker_tcpc_init_recycle, .get_cc = numaker_tcpc_get_cc, .select_rp_value = numaker_tcpc_select_rp_value, diff --git a/drivers/usb_c/tcpc/ucpd_stm32.c b/drivers/usb_c/tcpc/ucpd_stm32.c index 2fca84346fc..1ad7e081bf7 100644 --- a/drivers/usb_c/tcpc/ucpd_stm32.c +++ b/drivers/usb_c/tcpc/ucpd_stm32.c @@ -1418,7 +1418,7 @@ static int ucpd_init(const struct device *dev) return 0; } -static const struct tcpc_driver_api driver_api = { +static DEVICE_API(tcpc, driver_api) = { .init = ucpd_init, .set_alert_handler_cb = ucpd_set_alert_handler_cb, .get_cc = ucpd_get_cc,