device: Rename config_info attribute to config
There use to be a config attribute of type device_config, on which config_info could be found. config_info was thus named that way to differentiate easily from config attribute in struct device. Now that there is no such device_config structure, config_info in structure device now, can be renamed to config. Semantically, it makes for sense. We have an attribute pointing to the configuration of the device driver instance. Configuration information is correct but has a redundant meaning. Fixes #27397 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
ca7a6f4a45
commit
a8cd162d2c
4 changed files with 23 additions and 23 deletions
|
@ -67,10 +67,10 @@ extern "C" {
|
|||
* pm_control_fn) and no API (@p api).
|
||||
*/
|
||||
#define DEVICE_INIT(dev_name, drv_name, init_fn, \
|
||||
data, cfg_info, level, prio) \
|
||||
data, cfg_ptr, level, prio) \
|
||||
DEVICE_DEFINE(dev_name, drv_name, init_fn, \
|
||||
device_pm_control_nop, \
|
||||
data, cfg_info, level, prio, NULL)
|
||||
data, cfg_ptr, level, prio, NULL)
|
||||
|
||||
/**
|
||||
* @def DEVICE_AND_API_INIT
|
||||
|
@ -79,10 +79,10 @@ extern "C" {
|
|||
* pm_control_fn).
|
||||
*/
|
||||
#define DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, \
|
||||
data, cfg_info, level, prio, api) \
|
||||
data, cfg_ptr, level, prio, api) \
|
||||
DEVICE_DEFINE(dev_name, drv_name, init_fn, \
|
||||
device_pm_control_nop, \
|
||||
data, cfg_info, level, prio, api)
|
||||
data, cfg_ptr, level, prio, api)
|
||||
|
||||
/**
|
||||
* @def DEVICE_DEFINE
|
||||
|
@ -111,7 +111,7 @@ extern "C" {
|
|||
*
|
||||
* @param data Pointer to the device's private data.
|
||||
*
|
||||
* @param cfg_info The address to the structure containing the
|
||||
* @param cfg_ptr The address to the structure containing the
|
||||
* configuration information for this instance of the driver.
|
||||
*
|
||||
* @param level The initialization level. See SYS_INIT() for
|
||||
|
@ -124,13 +124,13 @@ extern "C" {
|
|||
* used by the driver. Can be NULL.
|
||||
*/
|
||||
#define DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, \
|
||||
data, cfg_info, level, prio, api) \
|
||||
data, cfg_ptr, level, prio, api) \
|
||||
Z_DEVICE_DEFINE_PM(dev_name) \
|
||||
static Z_DECL_ALIGN(struct device) \
|
||||
DEVICE_NAME_GET(dev_name) __used \
|
||||
__attribute__((__section__(".device_" #level STRINGIFY(prio)))) = { \
|
||||
.name = drv_name, \
|
||||
.config_info = (cfg_info), \
|
||||
.config = (cfg_ptr), \
|
||||
.driver_api = (api), \
|
||||
.driver_data = (data), \
|
||||
Z_DEVICE_DEFINE_PM_INIT(dev_name, pm_control_fn) \
|
||||
|
@ -201,7 +201,7 @@ struct device {
|
|||
/** Name of the device instance */
|
||||
const char *name;
|
||||
/** Address of device instance config information */
|
||||
const void *config_info;
|
||||
const void *config;
|
||||
/** Address of the API structure exposed by the device instance */
|
||||
const void *driver_api;
|
||||
/** Address of the device instance private data */
|
||||
|
|
|
@ -311,7 +311,7 @@ typedef uint32_t gpio_flags_t;
|
|||
|
||||
/**
|
||||
* This structure is common to all GPIO drivers and is expected to be
|
||||
* the first element in the object pointed to by the config_info field
|
||||
* the first element in the object pointed to by the config field
|
||||
* in the device structure.
|
||||
*/
|
||||
struct gpio_driver_config {
|
||||
|
|
|
@ -619,7 +619,7 @@ static inline bool net_eth_get_vlan_status(struct net_if *iface)
|
|||
* @param pm_control_fn Pointer to device_pm_control function.
|
||||
* Can be empty function (device_pm_control_nop) if not implemented.
|
||||
* @param data Pointer to the device's private data.
|
||||
* @param cfg_info The address to the structure containing the
|
||||
* @param cfg The address to the structure containing the
|
||||
* configuration information for this instance of the driver.
|
||||
* @param prio The initialization level at which configuration occurs.
|
||||
* @param api Provides an initial pointer to the API function struct
|
||||
|
@ -628,18 +628,18 @@ static inline bool net_eth_get_vlan_status(struct net_if *iface)
|
|||
*/
|
||||
#if defined(CONFIG_NET_VLAN)
|
||||
#define ETH_NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
|
||||
data, cfg_info, prio, api, mtu) \
|
||||
data, cfg, prio, api, mtu) \
|
||||
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
|
||||
cfg_info, POST_KERNEL, prio, api); \
|
||||
cfg, POST_KERNEL, prio, api); \
|
||||
NET_L2_DATA_INIT(dev_name, 0, NET_L2_GET_CTX_TYPE(ETHERNET_L2)); \
|
||||
NET_IF_INIT(dev_name, 0, ETHERNET_L2, mtu, NET_VLAN_MAX_COUNT)
|
||||
|
||||
#else /* CONFIG_NET_VLAN */
|
||||
|
||||
#define ETH_NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
|
||||
data, cfg_info, prio, api, mtu) \
|
||||
data, cfg, prio, api, mtu) \
|
||||
NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
|
||||
data, cfg_info, prio, api, ETHERNET_L2, \
|
||||
data, cfg, prio, api, ETHERNET_L2, \
|
||||
NET_L2_GET_CTX_TYPE(ETHERNET_L2), mtu)
|
||||
|
||||
#endif /* CONFIG_NET_VLAN */
|
||||
|
|
|
@ -2220,7 +2220,7 @@ struct net_if_api {
|
|||
* @param pm_control_fn Pointer to device_pm_control function.
|
||||
* Can be empty function (device_pm_control_nop) if not implemented.
|
||||
* @param data Pointer to the device's private data.
|
||||
* @param cfg_info The address to the structure containing the
|
||||
* @param cfg The address to the structure containing the
|
||||
* configuration information for this instance of the driver.
|
||||
* @param prio The initialization level at which configuration occurs.
|
||||
* @param api Provides an initial pointer to the API function struct
|
||||
|
@ -2230,10 +2230,10 @@ struct net_if_api {
|
|||
* @param mtu Maximum transfer unit in bytes for this network interface.
|
||||
*/
|
||||
#define NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
|
||||
data, cfg_info, prio, api, l2, \
|
||||
data, cfg, prio, api, l2, \
|
||||
l2_ctx_type, mtu) \
|
||||
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
|
||||
cfg_info, POST_KERNEL, prio, api); \
|
||||
cfg, POST_KERNEL, prio, api); \
|
||||
NET_L2_DATA_INIT(dev_name, 0, l2_ctx_type); \
|
||||
NET_IF_INIT(dev_name, 0, l2, mtu, NET_IF_MAX_CONFIGS)
|
||||
|
||||
|
@ -2253,7 +2253,7 @@ struct net_if_api {
|
|||
* @param pm_control_fn Pointer to device_pm_control function.
|
||||
* Can be empty function (device_pm_control_nop) if not implemented.
|
||||
* @param data Pointer to the device's private data.
|
||||
* @param cfg_info The address to the structure containing the
|
||||
* @param cfg The address to the structure containing the
|
||||
* configuration information for this instance of the driver.
|
||||
* @param prio The initialization level at which configuration occurs.
|
||||
* @param api Provides an initial pointer to the API function struct
|
||||
|
@ -2263,10 +2263,10 @@ struct net_if_api {
|
|||
* @param mtu Maximum transfer unit in bytes for this network interface.
|
||||
*/
|
||||
#define NET_DEVICE_INIT_INSTANCE(dev_name, drv_name, instance, init_fn, \
|
||||
pm_control_fn, data, cfg_info, prio, \
|
||||
pm_control_fn, data, cfg, prio, \
|
||||
api, l2, l2_ctx_type, mtu) \
|
||||
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
|
||||
cfg_info, POST_KERNEL, prio, api); \
|
||||
cfg, POST_KERNEL, prio, api); \
|
||||
NET_L2_DATA_INIT(dev_name, instance, l2_ctx_type); \
|
||||
NET_IF_INIT(dev_name, instance, l2, mtu, NET_IF_MAX_CONFIGS)
|
||||
|
||||
|
@ -2284,7 +2284,7 @@ struct net_if_api {
|
|||
* @param pm_control_fn Pointer to device_pm_control function.
|
||||
* Can be empty function (device_pm_control_nop) if not implemented.
|
||||
* @param data Pointer to the device's private data.
|
||||
* @param cfg_info The address to the structure containing the
|
||||
* @param cfg The address to the structure containing the
|
||||
* configuration information for this instance of the driver.
|
||||
* @param prio The initialization level at which configuration occurs.
|
||||
* @param api Provides an initial pointer to the API function struct
|
||||
|
@ -2292,10 +2292,10 @@ struct net_if_api {
|
|||
* @param mtu Maximum transfer unit in bytes for this network interface.
|
||||
*/
|
||||
#define NET_DEVICE_OFFLOAD_INIT(dev_name, drv_name, init_fn, \
|
||||
pm_control_fn, data, cfg_info, prio, \
|
||||
pm_control_fn, data, cfg, prio, \
|
||||
api, mtu) \
|
||||
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
|
||||
cfg_info, POST_KERNEL, prio, api); \
|
||||
cfg, POST_KERNEL, prio, api); \
|
||||
NET_IF_OFFLOAD_INIT(dev_name, 0, mtu)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue