kernel: device: Add const qualifier to device_config
Device config structure is placed in rom section but there was no const prefix used. Lack of prefix suggested that structure is in ram (ram_report is also fooled). Added const prefix to explicitly inform that it goes to rom. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
46ac596ee6
commit
a8b5a2e65e
2 changed files with 3 additions and 3 deletions
|
@ -101,7 +101,7 @@ extern "C" {
|
|||
#ifndef CONFIG_DEVICE_POWER_MANAGEMENT
|
||||
#define DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, data, cfg_info, \
|
||||
level, prio, api) \
|
||||
static struct device_config _CONCAT(__config_, dev_name) __used \
|
||||
static const struct device_config _CONCAT(__config_, dev_name) __used \
|
||||
__attribute__((__section__(".devconfig.init"))) = { \
|
||||
.name = drv_name, .init = (init_fn), \
|
||||
.config_info = (cfg_info) \
|
||||
|
@ -272,7 +272,7 @@ struct device_config {
|
|||
* @param driver_data driver instance data. For driver use only
|
||||
*/
|
||||
struct device {
|
||||
struct device_config *config;
|
||||
const struct device_config *config;
|
||||
const void *driver_api;
|
||||
void *driver_data;
|
||||
};
|
||||
|
|
|
@ -49,7 +49,7 @@ void z_sys_device_do_config_level(s32_t level)
|
|||
for (info = config_levels[level]; info < config_levels[level+1];
|
||||
info++) {
|
||||
int retval;
|
||||
struct device_config *device_conf = info->config;
|
||||
const struct device_config *device_conf = info->config;
|
||||
|
||||
retval = device_conf->init(info);
|
||||
if (retval != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue