From e8bcaff0ee8aecab561cea3c984a2e97592bd6b9 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 22 Dec 2021 12:02:25 +0100 Subject: [PATCH] device: deprecate SYS_DEVICE_DEFINE Deprecate the SYS_DEVICE_DEFINE macro in favor of SYS_INIT. Signed-off-by: Gerard Marull-Paretas --- include/device.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/device.h b/include/device.h index 6c29b82331d..db281421d7d 100644 --- a/include/device.h +++ b/include/device.h @@ -100,20 +100,15 @@ typedef int16_t device_handle_t; * * @brief Run an initialization function at boot at specified priority. * - * @details This macro allows you to use the device infrastructure to - * run a function at boot time. It is equivalent to - * DEVICE_DEFINE(dev_name, drv_name, init_fn, NULL, NULL, NULL, - * level, prio, NULL), where @p dev_name is derived from @p init_fn. + * @deprecated Use SYS_INIT() instead. * - * @param drv_name A string name for the pseudo-device. + * @param drv_name A string name for the pseudo-device (unused). * @param init_fn Pointer to the function which should run at boot time. * @param level Initialization level to run the function in. * @param prio Function's priority within its initialization level. - * @see DEVICE_DEFINE() */ #define SYS_DEVICE_DEFINE(drv_name, init_fn, level, prio) \ - DEVICE_DEFINE(Z_SYS_NAME(init_fn), drv_name, init_fn, NULL, \ - NULL, NULL, level, prio, NULL) + __DEPRECATED_MACRO SYS_INIT(init_fn, level, prio) /* Node paths can exceed the maximum size supported by device_get_binding() in user mode, * so synthesize a unique dev_name from the devicetree node.