device: Instantiate all device instance as constant
As they are set at build time. Fixes #27399 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
2fcf76219e
commit
c8906fef79
1 changed files with 2 additions and 2 deletions
|
@ -126,7 +126,7 @@ extern "C" {
|
||||||
#define DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, \
|
#define DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, \
|
||||||
data_ptr, cfg_ptr, level, prio, api_ptr) \
|
data_ptr, cfg_ptr, level, prio, api_ptr) \
|
||||||
Z_DEVICE_DEFINE_PM(dev_name) \
|
Z_DEVICE_DEFINE_PM(dev_name) \
|
||||||
static Z_DECL_ALIGN(struct device) \
|
static const Z_DECL_ALIGN(struct device) \
|
||||||
DEVICE_NAME_GET(dev_name) __used \
|
DEVICE_NAME_GET(dev_name) __used \
|
||||||
__attribute__((__section__(".device_" #level STRINGIFY(prio)))) = { \
|
__attribute__((__section__(".device_" #level STRINGIFY(prio)))) = { \
|
||||||
.name = drv_name, \
|
.name = drv_name, \
|
||||||
|
@ -167,7 +167,7 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @param name Device name
|
* @param name Device name
|
||||||
*/
|
*/
|
||||||
#define DEVICE_DECLARE(name) static struct device DEVICE_NAME_GET(name)
|
#define DEVICE_DECLARE(name) static const struct device DEVICE_NAME_GET(name)
|
||||||
|
|
||||||
typedef void (*device_pm_cb)(struct device *dev,
|
typedef void (*device_pm_cb)(struct device *dev,
|
||||||
int status, void *context, void *arg);
|
int status, void *context, void *arg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue