device: Apply driver_api/data attributes rename everywhere

Via coccinelle:

@r_device_driver_api_and_data_1@
struct device *D;
@@
(
D->
-	driver_api
+	api
|
D->
-	driver_data
+	data
)

@r_device_driver_api_and_data_2@
expression E;
@@
(
net_if_get_device(E)->
-	driver_api
+	api
|
net_if_get_device(E)->
-	driver_data
+	data
)

And grep/sed rules for macros:

git grep -rlz 'dev)->driver_data' |
	xargs -0 sed -i 's/dev)->driver_data/dev)->data/g'

git grep -rlz 'dev->driver_data' |
	xargs -0 sed -i 's/dev->driver_data/dev->data/g'

git grep -rlz 'device->driver_data' |
	xargs -0 sed -i 's/device->driver_data/device->data/g'

Fixes #27397

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-05-28 21:23:02 +02:00 committed by Carles Cufí
parent d86f79cbd7
commit 98d9b01322
498 changed files with 2085 additions and 2087 deletions

View file

@ -523,7 +523,7 @@ For example:
((const struct my_driver_config *)((_dev)->config))
#define DEV_DATA(_dev) \
((struct my_driver_dev_data *)((_dev)->driver_data))
((struct my_driver_dev_data *)((_dev)->data))
const static struct my_driver_config my_driver_config_0 = {
...

View file

@ -177,7 +177,7 @@ static int lmp90xxx_read_reg(struct device *dev, uint8_t addr, uint8_t *dptr,
size_t len)
{
const struct lmp90xxx_config *config = dev->config;
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
uint8_t ura = LMP90XXX_URA(addr);
uint8_t inst1_uab[2] = { LMP90XXX_INST1_WAB, ura };
uint8_t inst2 = LMP90XXX_INST2_R | LMP90XXX_LRA(addr);
@ -251,7 +251,7 @@ static int lmp90xxx_write_reg(struct device *dev, uint8_t addr, uint8_t *dptr,
size_t len)
{
const struct lmp90xxx_config *config = dev->config;
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
uint8_t ura = LMP90XXX_URA(addr);
uint8_t inst1_uab[2] = { LMP90XXX_INST1_WAB, ura };
uint8_t inst2 = LMP90XXX_INST2_WB | LMP90XXX_LRA(addr);
@ -380,7 +380,7 @@ static inline int lmp90xxx_acq_time_to_odr(uint16_t acq_time)
static int lmp90xxx_adc_channel_setup(struct device *dev,
const struct adc_channel_cfg *channel_cfg)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
uint8_t chx_inputcn = LMP90XXX_BURNOUT_EN(0); /* No burnout currents */
uint8_t chx_config = LMP90XXX_BUF_EN(0); /* No buffer */
uint8_t payload[2];
@ -498,7 +498,7 @@ static int lmp90xxx_adc_start_read(struct device *dev,
const struct adc_sequence *sequence)
{
const struct lmp90xxx_config *config = dev->config;
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err;
if (sequence->resolution != config->resolution) {
@ -529,7 +529,7 @@ static int lmp90xxx_adc_read_async(struct device *dev,
const struct adc_sequence *sequence,
struct k_poll_signal *async)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err;
adc_context_lock(&data->ctx, async ? true : false, async);
@ -571,7 +571,7 @@ static int lmp90xxx_adc_read_channel(struct device *dev, uint8_t channel,
int32_t *result)
{
const struct lmp90xxx_config *config = dev->config;
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
uint8_t adc_done;
uint8_t ch_scan;
uint8_t buf[4]; /* ADC_DOUT + CRC */
@ -649,7 +649,7 @@ static int lmp90xxx_adc_read_channel(struct device *dev, uint8_t channel,
static void lmp90xxx_acquisition_thread(struct device *dev)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
uint8_t bgcalcn = LMP90XXX_BGCALN(0x3); /* Default to BgCalMode3 */
int32_t result = 0;
uint8_t channel;
@ -712,7 +712,7 @@ static void lmp90xxx_drdyb_callback(struct device *port,
#ifdef CONFIG_ADC_LMP90XXX_GPIO
int lmp90xxx_gpio_set_output(struct device *dev, uint8_t pin)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err = 0;
uint8_t tmp;
@ -737,7 +737,7 @@ int lmp90xxx_gpio_set_output(struct device *dev, uint8_t pin)
int lmp90xxx_gpio_set_input(struct device *dev, uint8_t pin)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err = 0;
uint8_t tmp;
@ -762,7 +762,7 @@ int lmp90xxx_gpio_set_input(struct device *dev, uint8_t pin)
int lmp90xxx_gpio_set_pin_value(struct device *dev, uint8_t pin, bool value)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err = 0;
uint8_t tmp;
@ -789,7 +789,7 @@ int lmp90xxx_gpio_set_pin_value(struct device *dev, uint8_t pin, bool value)
int lmp90xxx_gpio_get_pin_value(struct device *dev, uint8_t pin, bool *value)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err = 0;
uint8_t tmp;
@ -811,7 +811,7 @@ int lmp90xxx_gpio_get_pin_value(struct device *dev, uint8_t pin, bool *value)
int lmp90xxx_gpio_port_get_raw(struct device *dev, gpio_port_value_t *value)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
uint8_t tmp;
int err;
@ -829,7 +829,7 @@ int lmp90xxx_gpio_port_set_masked_raw(struct device *dev,
gpio_port_pins_t mask,
gpio_port_value_t value)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err = 0;
uint8_t tmp;
@ -850,7 +850,7 @@ int lmp90xxx_gpio_port_set_masked_raw(struct device *dev,
int lmp90xxx_gpio_port_set_bits_raw(struct device *dev, gpio_port_pins_t pins)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err = 0;
uint8_t tmp;
@ -872,7 +872,7 @@ int lmp90xxx_gpio_port_set_bits_raw(struct device *dev, gpio_port_pins_t pins)
int lmp90xxx_gpio_port_clear_bits_raw(struct device *dev,
gpio_port_pins_t pins)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
int err = 0;
uint8_t tmp;
@ -893,7 +893,7 @@ int lmp90xxx_gpio_port_clear_bits_raw(struct device *dev,
int lmp90xxx_gpio_port_toggle_bits(struct device *dev, gpio_port_pins_t pins)
{
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
uint8_t tmp;
int err;
@ -915,7 +915,7 @@ int lmp90xxx_gpio_port_toggle_bits(struct device *dev, gpio_port_pins_t pins)
static int lmp90xxx_init(struct device *dev)
{
const struct lmp90xxx_config *config = dev->config;
struct lmp90xxx_data *data = dev->driver_data;
struct lmp90xxx_data *data = dev->data;
struct device *drdyb_dev;
k_tid_t tid;
int err;

View file

@ -150,7 +150,7 @@ static int adc_xec_start_read(struct device *dev,
const struct adc_sequence *sequence)
{
struct adc_xec_regs *adc_regs = ADC_XEC_REG_BASE;
struct adc_xec_data *data = dev->driver_data;
struct adc_xec_data *data = dev->data;
uint32_t reg;
if (sequence->channels & ~BIT_MASK(MCHP_ADC_MAX_CHAN)) {
@ -194,7 +194,7 @@ static int adc_xec_start_read(struct device *dev,
static int adc_xec_read(struct device *dev,
const struct adc_sequence *sequence)
{
struct adc_xec_data *data = dev->driver_data;
struct adc_xec_data *data = dev->data;
int error;
adc_context_lock(&data->ctx, false, NULL);
@ -209,7 +209,7 @@ static int adc_xec_read_async(struct device *dev,
const struct adc_sequence *sequence,
struct k_poll_signal *async)
{
struct adc_xec_data *data = dev->driver_data;
struct adc_xec_data *data = dev->data;
int error;
adc_context_lock(&data->ctx, true, async);
@ -223,7 +223,7 @@ static int adc_xec_read_async(struct device *dev,
static void xec_adc_get_sample(struct device *dev)
{
struct adc_xec_regs *adc_regs = ADC_XEC_REG_BASE;
struct adc_xec_data *data = dev->driver_data;
struct adc_xec_data *data = dev->data;
uint32_t idx;
uint32_t channels = adc_regs->status_reg;
uint32_t ch_status = channels;
@ -254,7 +254,7 @@ static void xec_adc_get_sample(struct device *dev)
static void adc_xec_isr(struct device *dev)
{
struct adc_xec_regs *adc_regs = ADC_XEC_REG_BASE;
struct adc_xec_data *data = dev->driver_data;
struct adc_xec_data *data = dev->data;
uint32_t reg;
/* Clear START_SINGLE bit and clear SINGLE_DONE_STATUS */
@ -285,7 +285,7 @@ struct adc_driver_api adc_xec_api = {
static int adc_xec_init(struct device *dev)
{
struct adc_xec_regs *adc_regs = ADC_XEC_REG_BASE;
struct adc_xec_data *data = dev->driver_data;
struct adc_xec_data *data = dev->data;
adc_regs->control_reg = XEC_ADC_CTRL_ACTIVATE
| XEC_ADC_CTRL_POWER_SAVER_DIS

View file

@ -53,7 +53,7 @@ static int mcp320x_channel_setup(struct device *dev,
const struct adc_channel_cfg *channel_cfg)
{
const struct mcp320x_config *config = dev->config;
struct mcp320x_data *data = dev->driver_data;
struct mcp320x_data *data = dev->data;
if (channel_cfg->gain != ADC_GAIN_1) {
LOG_ERR("unsupported channel gain '%d'", channel_cfg->gain);
@ -113,7 +113,7 @@ static int mcp320x_start_read(struct device *dev,
const struct adc_sequence *sequence)
{
const struct mcp320x_config *config = dev->config;
struct mcp320x_data *data = dev->driver_data;
struct mcp320x_data *data = dev->data;
int err;
if (sequence->resolution != MCP320X_RESOLUTION) {
@ -143,7 +143,7 @@ static int mcp320x_read_async(struct device *dev,
const struct adc_sequence *sequence,
struct k_poll_signal *async)
{
struct mcp320x_data *data = dev->driver_data;
struct mcp320x_data *data = dev->data;
int err;
adc_context_lock(&data->ctx, async ? true : false, async);
@ -182,7 +182,7 @@ static void adc_context_update_buffer_pointer(struct adc_context *ctx,
static int mcp320x_read_channel(struct device *dev, uint8_t channel, uint16_t *result)
{
const struct mcp320x_config *config = dev->config;
struct mcp320x_data *data = dev->driver_data;
struct mcp320x_data *data = dev->data;
uint8_t tx_bytes[2];
uint8_t rx_bytes[2];
int err;
@ -239,7 +239,7 @@ static int mcp320x_read_channel(struct device *dev, uint8_t channel, uint16_t *r
static void mcp320x_acquisition_thread(struct device *dev)
{
struct mcp320x_data *data = dev->driver_data;
struct mcp320x_data *data = dev->data;
uint16_t result = 0;
uint8_t channel;
int err;
@ -274,7 +274,7 @@ static void mcp320x_acquisition_thread(struct device *dev)
static int mcp320x_init(struct device *dev)
{
const struct mcp320x_config *config = dev->config;
struct mcp320x_data *data = dev->driver_data;
struct mcp320x_data *data = dev->data;
k_sem_init(&data->sem, 0, 1);
data->spi_dev = device_get_binding(config->spi_dev_name);

View file

@ -74,7 +74,7 @@ static int mcux_adc12_start_read(struct device *dev,
const struct adc_sequence *sequence)
{
const struct mcux_adc12_config *config = dev->config;
struct mcux_adc12_data *data = dev->driver_data;
struct mcux_adc12_data *data = dev->data;
adc12_hardware_average_mode_t mode;
adc12_resolution_t resolution;
ADC_Type *base = config->base;
@ -134,7 +134,7 @@ static int mcux_adc12_read_async(struct device *dev,
const struct adc_sequence *sequence,
struct k_poll_signal *async)
{
struct mcux_adc12_data *data = dev->driver_data;
struct mcux_adc12_data *data = dev->data;
int error;
adc_context_lock(&data->ctx, async ? true : false, async);
@ -153,7 +153,7 @@ static int mcux_adc12_read(struct device *dev,
static void mcux_adc12_start_channel(struct device *dev)
{
const struct mcux_adc12_config *config = dev->config;
struct mcux_adc12_data *data = dev->driver_data;
struct mcux_adc12_data *data = dev->data;
adc12_channel_config_t channel_config;
uint32_t channel_group = 0U;
@ -192,7 +192,7 @@ static void mcux_adc12_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct mcux_adc12_config *config = dev->config;
struct mcux_adc12_data *data = dev->driver_data;
struct mcux_adc12_data *data = dev->data;
ADC_Type *base = config->base;
uint32_t channel_group = 0U;
uint16_t result;
@ -214,7 +214,7 @@ static void mcux_adc12_isr(void *arg)
static int mcux_adc12_init(struct device *dev)
{
const struct mcux_adc12_config *config = dev->config;
struct mcux_adc12_data *data = dev->driver_data;
struct mcux_adc12_data *data = dev->data;
ADC_Type *base = config->base;
adc12_config_t adc_config;

View file

@ -67,7 +67,7 @@ static int mcux_adc16_channel_setup(struct device *dev,
static int start_read(struct device *dev, const struct adc_sequence *sequence)
{
const struct mcux_adc16_config *config = dev->config;
struct mcux_adc16_data *data = dev->driver_data;
struct mcux_adc16_data *data = dev->data;
adc16_hardware_average_mode_t mode;
adc16_resolution_t resolution;
int error;
@ -134,7 +134,7 @@ static int start_read(struct device *dev, const struct adc_sequence *sequence)
static int mcux_adc16_read(struct device *dev,
const struct adc_sequence *sequence)
{
struct mcux_adc16_data *data = dev->driver_data;
struct mcux_adc16_data *data = dev->data;
int error;
adc_context_lock(&data->ctx, false, NULL);
@ -149,7 +149,7 @@ static int mcux_adc16_read_async(struct device *dev,
const struct adc_sequence *sequence,
struct k_poll_signal *async)
{
struct mcux_adc16_data *data = dev->driver_data;
struct mcux_adc16_data *data = dev->data;
int error;
adc_context_lock(&data->ctx, true, async);
@ -163,7 +163,7 @@ static int mcux_adc16_read_async(struct device *dev,
static void mcux_adc16_start_channel(struct device *dev)
{
const struct mcux_adc16_config *config = dev->config;
struct mcux_adc16_data *data = dev->driver_data;
struct mcux_adc16_data *data = dev->data;
adc16_channel_config_t channel_config;
uint32_t channel_group = 0U;
@ -206,7 +206,7 @@ static void mcux_adc16_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct mcux_adc16_config *config = dev->config;
struct mcux_adc16_data *data = dev->driver_data;
struct mcux_adc16_data *data = dev->data;
ADC_Type *base = config->base;
uint32_t channel_group = 0U;
uint16_t result;
@ -228,7 +228,7 @@ static void mcux_adc16_isr(void *arg)
static int mcux_adc16_init(struct device *dev)
{
const struct mcux_adc16_config *config = dev->config;
struct mcux_adc16_data *data = dev->driver_data;
struct mcux_adc16_data *data = dev->data;
ADC_Type *base = config->base;
adc16_config_t adc_config;

View file

@ -61,7 +61,7 @@ struct adc_sam0_cfg {
#define DEV_CFG(dev) \
((const struct adc_sam0_cfg *const)(dev)->config)
#define DEV_DATA(dev) \
((struct adc_sam0_data *)(dev)->driver_data)
((struct adc_sam0_data *)(dev)->data)
static void wait_synchronization(Adc *const adc)
{

View file

@ -66,7 +66,7 @@ struct adc_sam_cfg {
((const struct adc_sam_cfg *const)(dev)->config)
#define DEV_DATA(dev) \
((struct adc_sam_data *)(dev)->driver_data)
((struct adc_sam_data *)(dev)->data)
static int adc_sam_channel_setup(struct device *dev,
const struct adc_channel_cfg *channel_cfg)

View file

@ -266,7 +266,7 @@ static void adc_stm32_start_conversion(struct device *dev)
static int start_read(struct device *dev, const struct adc_sequence *sequence)
{
const struct adc_stm32_cfg *config = dev->config;
struct adc_stm32_data *data = dev->driver_data;
struct adc_stm32_data *data = dev->data;
ADC_TypeDef *adc = (ADC_TypeDef *)config->base;
uint8_t resolution;
int err;
@ -388,7 +388,7 @@ static void adc_context_update_buffer_pointer(struct adc_context *ctx,
static void adc_stm32_isr(void *arg)
{
struct device *dev = (struct device *)arg;
struct adc_stm32_data *data = (struct adc_stm32_data *)dev->driver_data;
struct adc_stm32_data *data = (struct adc_stm32_data *)dev->data;
const struct adc_stm32_cfg *config =
(const struct adc_stm32_cfg *)dev->config;
ADC_TypeDef *adc = config->base;
@ -403,7 +403,7 @@ static void adc_stm32_isr(void *arg)
static int adc_stm32_read(struct device *dev,
const struct adc_sequence *sequence)
{
struct adc_stm32_data *data = dev->driver_data;
struct adc_stm32_data *data = dev->data;
int error;
adc_context_lock(&data->ctx, false, NULL);
@ -418,7 +418,7 @@ static int adc_stm32_read_async(struct device *dev,
const struct adc_sequence *sequence,
struct k_poll_signal *async)
{
struct adc_stm32_data *data = dev->driver_data;
struct adc_stm32_data *data = dev->data;
int error;
adc_context_lock(&data->ctx, true, async);
@ -467,7 +467,7 @@ static int adc_stm32_channel_setup(struct device *dev,
const struct adc_channel_cfg *channel_cfg)
{
#if defined(CONFIG_SOC_SERIES_STM32F0X) || defined(CONFIG_SOC_SERIES_STM32L0X)
struct adc_stm32_data *data = dev->driver_data;
struct adc_stm32_data *data = dev->data;
#endif
int acq_time_index;
@ -544,7 +544,7 @@ static void adc_stm32_calib(struct device *dev)
static int adc_stm32_init(struct device *dev)
{
struct adc_stm32_data *data = dev->driver_data;
struct adc_stm32_data *data = dev->data;
const struct adc_stm32_cfg *config = dev->config;
struct device *clk =
device_get_binding(STM32_CLOCK_CONTROL_NAME);

View file

@ -22,7 +22,7 @@ extern "C" {
#define DEV_CFG(dev) \
((const struct mpxxdtyy_config *const)(dev)->config)
#define DEV_DATA(dev) \
((struct mpxxdtyy_data *const)(dev)->driver_data)
((struct mpxxdtyy_data *const)(dev)->data)
struct mpxxdtyy_data {
struct device *comm_master;

View file

@ -53,7 +53,7 @@ static struct codec_driver_data codec_device_data;
#define DEV_CFG(dev) \
((struct codec_driver_config *const)(dev)->config)
#define DEV_DATA(dev) \
((struct codec_driver_data *const)(dev)->driver_data)
((struct codec_driver_data *const)(dev)->data)
static void codec_write_reg(struct device *dev, struct reg_addr reg, uint8_t val);
static void codec_read_reg(struct device *dev, struct reg_addr reg, uint8_t *val);

View file

@ -42,7 +42,7 @@ static void can_msgq_put(struct zcan_frame *frame, void *arg)
int z_impl_can_attach_msgq(struct device *dev, struct k_msgq *msg_q,
const struct zcan_filter *filter)
{
const struct can_driver_api *api = dev->driver_api;
const struct can_driver_api *api = dev->api;
return api->attach_isr(dev, can_msgq_put, msg_q, filter);
}
@ -133,7 +133,7 @@ int can_attach_workq(struct device *dev, struct k_work_q *work_q,
can_rx_callback_t callback, void *callback_arg,
const struct zcan_filter *filter)
{
const struct can_driver_api *api = dev->driver_api;
const struct can_driver_api *api = dev->api;
k_work_init(&work->work_item, can_work_handler);
work->work_queue = work_q;

View file

@ -288,7 +288,7 @@ DEVICE_AND_API_INIT(can_loopback_1, CONFIG_CAN_LOOPBACK_DEV_NAME,
static int socket_can_init_1(struct device *dev)
{
struct device *can_dev = DEVICE_GET(can_loopback_1);
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
dev, dev->name, can_dev, can_dev->name);

View file

@ -10,7 +10,7 @@
#include <drivers/can.h>
#define DEV_DATA(dev) ((struct can_loopback_data *const)(dev)->driver_data)
#define DEV_DATA(dev) ((struct can_loopback_data *const)(dev)->data)
#define DEV_CFG(dev) \
((const struct can_loopback_config *const)(dev)->config)

View file

@ -16,7 +16,7 @@
#define DEV_CFG(dev) \
((const struct mcp2515_config *const)(dev)->config)
#define DEV_DATA(dev) ((struct mcp2515_data *const)(dev)->driver_data)
#define DEV_DATA(dev) ((struct mcp2515_data *const)(dev)->data)
struct mcp2515_tx_cb {
struct k_sem sem;

View file

@ -250,7 +250,7 @@ static int mcux_flexcan_send(struct device *dev, const struct zcan_frame *msg,
can_tx_callback_t callback_isr, void *callback_arg)
{
const struct mcux_flexcan_config *config = dev->config;
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
flexcan_mb_transfer_t xfer;
status_t status;
int alloc;
@ -300,7 +300,7 @@ static int mcux_flexcan_attach_isr(struct device *dev, can_rx_callback_t isr,
const struct zcan_filter *filter)
{
const struct mcux_flexcan_config *config = dev->config;
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
flexcan_mb_transfer_t xfer;
status_t status;
uint32_t mask;
@ -353,7 +353,7 @@ static int mcux_flexcan_attach_isr(struct device *dev, can_rx_callback_t isr,
static void mcux_flexcan_register_state_change_isr(struct device *dev,
can_state_change_isr_t isr)
{
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
data->state_change_isr = isr;
}
@ -415,7 +415,7 @@ int mcux_flexcan_recover(struct device *dev, k_timeout_t timeout)
static void mcux_flexcan_detach(struct device *dev, int filter_id)
{
const struct mcux_flexcan_config *config = dev->config;
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
if (filter_id >= MCUX_FLEXCAN_MAX_RX) {
LOG_ERR("Detach: Filter id >= MAX_RX (%d >= %d)", filter_id,
@ -444,7 +444,7 @@ static inline void mcux_flexcan_transfer_error_status(struct device *dev,
uint32_t error)
{
const struct mcux_flexcan_config *config = dev->config;
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
can_tx_callback_t function;
int status = CAN_TX_OK;
void *arg;
@ -520,7 +520,7 @@ static inline void mcux_flexcan_transfer_error_status(struct device *dev,
static inline void mcux_flexcan_transfer_tx_idle(struct device *dev,
uint32_t mb)
{
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
can_tx_callback_t function;
void *arg;
int alloc;
@ -546,7 +546,7 @@ static inline void mcux_flexcan_transfer_rx_idle(struct device *dev,
uint32_t mb)
{
const struct mcux_flexcan_config *config = dev->config;
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
can_rx_callback_t function;
flexcan_mb_transfer_t xfer;
struct zcan_frame frame;
@ -611,7 +611,7 @@ static void mcux_flexcan_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct mcux_flexcan_config *config = dev->config;
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
FLEXCAN_TransferHandleIRQ(config->base, &data->handle);
}
@ -619,7 +619,7 @@ static void mcux_flexcan_isr(void *arg)
static int mcux_flexcan_init(struct device *dev)
{
const struct mcux_flexcan_config *config = dev->config;
struct mcux_flexcan_data *data = dev->driver_data;
struct mcux_flexcan_data *data = dev->data;
int err;
int i;
@ -734,7 +734,7 @@ static void mcux_flexcan_config_func_0(struct device *dev)
static int socket_can_init_0(struct device *dev)
{
struct device *can_dev = DEVICE_GET(can_mcux_flexcan_0);
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
dev, dev->name, can_dev, can_dev->name);

View file

@ -91,7 +91,7 @@ static inline void can_set_lladdr(struct net_pkt *pkt, struct zcan_frame *frame)
static int net_can_send(struct device *dev, const struct zcan_frame *frame,
can_tx_callback_t cb, void *cb_arg, k_timeout_t timeout)
{
struct net_can_context *ctx = dev->driver_data;
struct net_can_context *ctx = dev->data;
NET_ASSERT(frame->id_type == CAN_EXTENDED_IDENTIFIER);
return can_send(ctx->can_dev, frame, timeout, cb, cb_arg);
@ -173,7 +173,7 @@ static void mcast_cb(struct net_if *iface, const struct in6_addr *addr,
bool is_joined)
{
struct device *dev = net_if_get_device(iface);
struct net_can_context *ctx = dev->driver_data;
struct net_can_context *ctx = dev->data;
struct mcast_filter_mapping *filter_mapping;
int filter_id;
@ -206,7 +206,7 @@ static void mcast_cb(struct net_if *iface, const struct in6_addr *addr,
static void net_can_iface_init(struct net_if *iface)
{
struct device *dev = net_if_get_device(iface);
struct net_can_context *ctx = dev->driver_data;
struct net_can_context *ctx = dev->data;
ctx->iface = iface;
@ -221,14 +221,14 @@ static int can_attach_filter(struct device *dev, can_rx_callback_t cb,
void *cb_arg,
const struct zcan_filter *filter)
{
struct net_can_context *ctx = dev->driver_data;
struct net_can_context *ctx = dev->data;
return can_attach_isr(ctx->can_dev, cb, cb_arg, filter);
}
static void can_detach_filter(struct device *dev, int filter_id)
{
struct net_can_context *ctx = dev->driver_data;
struct net_can_context *ctx = dev->data;
if (filter_id >= 0) {
can_detach(ctx->can_dev, filter_id);
@ -314,7 +314,7 @@ static inline int can_attach_all_mcast_filter(struct net_can_context *ctx)
static int can_enable(struct device *dev, bool enable)
{
struct net_can_context *ctx = dev->driver_data;
struct net_can_context *ctx = dev->data;
if (enable) {
if (ctx->recv_filter_id == CAN_NET_FILTER_NOT_SET) {
@ -373,7 +373,7 @@ static struct net_can_api net_can_api_inst = {
static int net_can_init(struct device *dev)
{
struct device *can_dev;
struct net_can_context *ctx = dev->driver_data;
struct net_can_context *ctx = dev->data;
can_dev = device_get_binding(DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL);

View file

@ -1106,7 +1106,7 @@ static void config_can_1_irq(CAN_TypeDef *can)
static int socket_can_init_1(struct device *dev)
{
struct device *can_dev = DEVICE_GET(can_stm32_1);
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
dev, dev->name, can_dev, can_dev->name);
@ -1189,7 +1189,7 @@ static void config_can_2_irq(CAN_TypeDef *can)
static int socket_can_init_2(struct device *dev)
{
struct device *can_dev = DEVICE_GET(can_stm32_2);
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
dev, dev->name, can_dev, can_dev->name);

View file

@ -10,7 +10,7 @@
#include <drivers/can.h>
#define DEV_DATA(dev) ((struct can_stm32_data *const)(dev)->driver_data)
#define DEV_DATA(dev) ((struct can_stm32_data *const)(dev)->data)
#define DEV_CFG(dev) \
((const struct can_stm32_config *const)(dev)->config)

View file

@ -36,7 +36,7 @@ struct socket_can_context {
static inline void socket_can_iface_init(struct net_if *iface)
{
struct device *dev = net_if_get_device(iface);
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
socket_context->iface = iface;
@ -55,7 +55,7 @@ static inline void tx_irq_callback(uint32_t error_flags, void *arg)
/* This is called by net_if.c when packet is about to be sent */
static inline int socket_can_send(struct device *dev, struct net_pkt *pkt)
{
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
int ret;
if (net_pkt_family(pkt) != AF_CAN) {
@ -79,7 +79,7 @@ static inline int socket_can_setsockopt(struct device *dev, void *obj,
int level, int optname,
const void *optval, socklen_t optlen)
{
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
struct net_context *ctx = obj;
int ret;
@ -104,7 +104,7 @@ static inline int socket_can_setsockopt(struct device *dev, void *obj,
static inline void socket_can_close(struct device *dev, int filter_id)
{
struct socket_can_context *socket_context = dev->driver_data;
struct socket_can_context *socket_context = dev->data;
can_detach(socket_context->can_dev, filter_id);
}

View file

@ -18,7 +18,7 @@
((dev)->config))
#define DEV_DATA(dev) ((struct lpc11u6x_syscon_data *) \
((dev)->driver_data))
((dev)->data))
static void syscon_power_up(struct lpc11u6x_syscon_regs *syscon,
uint32_t bit, bool enable)

View file

@ -109,7 +109,7 @@ static void clock_irqs_enable(void)
static struct nrf_clock_control_sub_data *get_sub_data(struct device *dev,
enum clock_control_nrf_type type)
{
struct nrf_clock_control_data *data = dev->driver_data;
struct nrf_clock_control_data *data = dev->data;
return &data->subsys[type];
}
@ -127,7 +127,7 @@ static const struct nrf_clock_control_sub_config *get_sub_config(
static struct onoff_manager *get_onoff_manager(struct device *dev,
enum clock_control_nrf_type type)
{
struct nrf_clock_control_data *data = dev->driver_data;
struct nrf_clock_control_data *data = dev->data;
return &data->mgr[type];
}
@ -263,8 +263,7 @@ static void hfclk_stop(void)
static uint32_t *get_hf_flags(void)
{
struct nrf_clock_control_data *data =
DEVICE_GET(clock_nrf)->driver_data;
struct nrf_clock_control_data *data = DEVICE_GET(clock_nrf)->data;
return &data->subsys[CLOCK_CONTROL_NRF_TYPE_HFCLK].flags;
}
@ -412,8 +411,7 @@ static int api_blocking_start(struct device *dev, clock_control_subsys_t subsys)
static clock_control_subsys_t get_subsys(struct onoff_manager *mgr)
{
struct nrf_clock_control_data *data =
DEVICE_GET(clock_nrf)->driver_data;
struct nrf_clock_control_data *data = DEVICE_GET(clock_nrf)->data;
size_t offset = (size_t)(mgr - data->mgr);
return (clock_control_subsys_t)offset;
@ -525,7 +523,7 @@ static int clk_init(struct device *dev)
nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC);
if (IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION)) {
struct nrf_clock_control_data *data = dev->driver_data;
struct nrf_clock_control_data *data = dev->data;
z_nrf_clock_calibration_init(data->mgr);
}

View file

@ -27,7 +27,7 @@ static void ipm_console_thread(void *arg1, void *arg2, void *arg3)
int pos;
d = (struct device *)arg1;
driver_data = d->driver_data;
driver_data = d->data;
config_info = d->config;
ARG_UNUSED(arg2);
size32 = 0U;
@ -93,7 +93,7 @@ static void ipm_console_receive_callback(struct device *ipm_dev, void *context,
ARG_UNUSED(data);
d = context;
driver_data = d->driver_data;
driver_data = d->data;
/* Should always be at least one free buffer slot */
ret = ring_buf_item_put(&driver_data->rb, 0, id, NULL, 0);
@ -119,7 +119,7 @@ int ipm_console_receiver_init(struct device *d)
{
const struct ipm_console_receiver_config_info *config_info =
d->config;
struct ipm_console_receiver_runtime_data *driver_data = d->driver_data;
struct ipm_console_receiver_runtime_data *driver_data = d->data;
struct device *ipm;
ipm = device_get_binding(config_info->bind_to);

View file

@ -88,7 +88,7 @@ struct uart_mux_config {
};
#define DEV_DATA(dev) \
((struct uart_mux_dev_data *)(dev)->driver_data)
((struct uart_mux_dev_data *)(dev)->data)
struct uart_mux_dev_data {
sys_snode_t node;

View file

@ -43,7 +43,7 @@ struct counter_gecko_data {
#define DEV_CFG(dev) \
((const struct counter_gecko_config * const)(dev)->config)
#define DEV_DATA(dev) \
((struct counter_gecko_data *const)(dev)->driver_data)
((struct counter_gecko_data *const)(dev)->data)
#ifdef CONFIG_SOC_GECKO_HAS_ERRATA_RTCC_E201
#define ERRATA_RTCC_E201_MESSAGE \

View file

@ -33,7 +33,7 @@ static void imx_epit_isr(void *arg)
{
struct device *dev = (struct device *)arg;
EPIT_Type *base = get_epit_config(dev)->base;
struct imx_epit_data *driver_data = dev->driver_data;
struct imx_epit_data *driver_data = dev->data;
EPIT_ClearStatusFlag(base);
@ -100,7 +100,7 @@ static int imx_epit_set_top_value(struct device *dev,
const struct counter_top_cfg *cfg)
{
EPIT_Type *base = get_epit_config(dev)->base;
struct imx_epit_data *driver_data = dev->driver_data;
struct imx_epit_data *driver_data = dev->data;
/* Disable EPIT Output Compare interrupt for consistency */
EPIT_SetIntCmd(base, false);

View file

@ -56,7 +56,7 @@ struct rtc_stm32_data {
};
#define DEV_DATA(dev) ((struct rtc_stm32_data *)(dev)->driver_data)
#define DEV_DATA(dev) ((struct rtc_stm32_data *)(dev)->data)
#define DEV_CFG(dev) \
((const struct rtc_stm32_config * const)(dev)->config)

View file

@ -55,7 +55,7 @@ struct counter_xec_data {
_dev->config))
#define COUNTER_XEC_DATA(_dev) \
((struct counter_xec_data *)dev->driver_data)
((struct counter_xec_data *)dev->data)
static int counter_xec_start(struct device *dev)
{

View file

@ -56,7 +56,7 @@ static int mcux_gpt_set_alarm(struct device *dev, uint8_t chan_id,
const struct counter_alarm_cfg *alarm_cfg)
{
const struct mcux_gpt_config *config = dev->config;
struct mcux_gpt_data *data = dev->driver_data;
struct mcux_gpt_data *data = dev->data;
uint32_t current = GPT_GetCurrentTimerCount(config->base);
uint32_t ticks = alarm_cfg->ticks;
@ -87,7 +87,7 @@ static int mcux_gpt_set_alarm(struct device *dev, uint8_t chan_id,
static int mcux_gpt_cancel_alarm(struct device *dev, uint8_t chan_id)
{
const struct mcux_gpt_config *config = dev->config;
struct mcux_gpt_data *data = dev->driver_data;
struct mcux_gpt_data *data = dev->data;
if (chan_id != 0) {
LOG_ERR("Invalid channel id");
@ -104,7 +104,7 @@ void mcux_gpt_isr(void *p)
{
struct device *dev = p;
const struct mcux_gpt_config *config = dev->config;
struct mcux_gpt_data *data = dev->driver_data;
struct mcux_gpt_data *data = dev->data;
uint32_t current = GPT_GetCurrentTimerCount(config->base);
uint32_t status;
@ -137,7 +137,7 @@ static int mcux_gpt_set_top_value(struct device *dev,
const struct counter_top_cfg *cfg)
{
const struct mcux_gpt_config *config = dev->config;
struct mcux_gpt_data *data = dev->driver_data;
struct mcux_gpt_data *data = dev->data;
if (cfg->ticks != config->info.max_top_value) {
LOG_ERR("Wrap can only be set to 0x%x",

View file

@ -61,7 +61,7 @@ static int mcux_lptmr_set_top_value(struct device *dev,
const struct counter_top_cfg *cfg)
{
const struct mcux_lptmr_config *config = dev->config;
struct mcux_lptmr_data *data = dev->driver_data;
struct mcux_lptmr_data *data = dev->data;
if (cfg->ticks == 0) {
return -EINVAL;
@ -115,7 +115,7 @@ static void mcux_lptmr_isr(void *arg)
{
struct device *dev = arg;
const struct mcux_lptmr_config *config = dev->config;
struct mcux_lptmr_data *data = dev->driver_data;
struct mcux_lptmr_data *data = dev->data;
uint32_t flags;
flags = LPTMR_GetStatusFlags(config->base);

View file

@ -93,7 +93,7 @@ static int mcux_rtc_set_alarm(struct device *dev, uint8_t chan_id,
const struct counter_config_info *info = dev->config;
const struct mcux_rtc_config *config =
CONTAINER_OF(info, struct mcux_rtc_config, info);
struct mcux_rtc_data *data = dev->driver_data;
struct mcux_rtc_data *data = dev->data;
uint32_t ticks = alarm_cfg->ticks;
uint32_t current = mcux_rtc_read(dev);
@ -129,7 +129,7 @@ static int mcux_rtc_set_alarm(struct device *dev, uint8_t chan_id,
static int mcux_rtc_cancel_alarm(struct device *dev, uint8_t chan_id)
{
struct mcux_rtc_data *data = dev->driver_data;
struct mcux_rtc_data *data = dev->data;
if (chan_id != 0U) {
LOG_ERR("Invalid channel id");
@ -147,7 +147,7 @@ static int mcux_rtc_set_top_value(struct device *dev,
const struct counter_config_info *info = dev->config;
const struct mcux_rtc_config *config =
CONTAINER_OF(info, struct mcux_rtc_config, info);
struct mcux_rtc_data *data = dev->driver_data;
struct mcux_rtc_data *data = dev->data;
if (cfg->ticks != info->max_top_value) {
LOG_ERR("Wrap can only be set to 0x%x.", info->max_top_value);
@ -195,7 +195,7 @@ static void mcux_rtc_isr(void *arg)
const struct counter_config_info *info = dev->config;
const struct mcux_rtc_config *config =
CONTAINER_OF(info, struct mcux_rtc_config, info);
struct mcux_rtc_data *data = dev->driver_data;
struct mcux_rtc_data *data = dev->data;
counter_alarm_callback_t cb;
uint32_t current = mcux_rtc_read(dev);

View file

@ -68,7 +68,7 @@ struct counter_nrfx_config {
static inline struct counter_nrfx_data *get_dev_data(struct device *dev)
{
return dev->driver_data;
return dev->data;
}
static inline const struct counter_nrfx_config *get_nrfx_config(

View file

@ -52,7 +52,7 @@ struct counter_timer_config {
static inline struct counter_nrfx_data *get_dev_data(struct device *dev)
{
return dev->driver_data;
return dev->data;
}
static inline const struct counter_nrfx_config *get_nrfx_config(

View file

@ -44,7 +44,7 @@ struct counter_sam0_tc32_config {
#define DEV_CFG(dev) ((const struct counter_sam0_tc32_config *const) \
(dev)->config)
#define DEV_DATA(dev) ((struct counter_sam0_tc32_data *const) \
(dev)->driver_data)
(dev)->data)
static void wait_synchronization(TcCount32 *regs)

View file

@ -148,7 +148,7 @@ static int sc_ctrl(struct device *dev,
uint8_t set,
uint8_t clear)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
struct register_map *rp = &data->registers;
uint8_t ctrl = (rp->ctrl & ~clear) | set;
@ -172,7 +172,7 @@ int maxim_ds3231_ctrl_update(struct device *dev,
uint8_t set_bits,
uint8_t clear_bits)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
k_sem_take(&data->lock, K_FOREVER);
@ -200,7 +200,7 @@ static inline int rsc_stat(struct device *dev,
{
uint8_t const ign = MAXIM_DS3231_REG_STAT_OSF | MAXIM_DS3231_ALARM1
| MAXIM_DS3231_ALARM2;
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
struct register_map *rp = &data->registers;
uint8_t addr = offsetof(struct register_map, ctrl_stat);
@ -230,7 +230,7 @@ int maxim_ds3231_stat_update(struct device *dev,
uint8_t set_bits,
uint8_t clear_bits)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
k_sem_take(&data->lock, K_FOREVER);
@ -247,7 +247,7 @@ int maxim_ds3231_stat_update(struct device *dev,
*/
static void validate_isw_monitoring(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
const struct register_map *rp = &data->registers;
uint8_t isw_mon_req = 0;
@ -448,7 +448,7 @@ static uint32_t decode_rtc(struct ds3231_data *data)
static int update_registers(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
uint32_t syncclock;
int rc;
@ -471,7 +471,7 @@ int maxim_ds3231_get_alarm(struct device *dev,
uint8_t id,
struct maxim_ds3231_alarm *cp)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
int rv = 0;
uint8_t addr;
@ -517,7 +517,7 @@ out:
static int cancel_alarm(struct device *dev,
uint8_t id)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
data->alarm_handler[id] = NULL;
data->alarm_user_data[id] = NULL;
@ -528,7 +528,7 @@ static int cancel_alarm(struct device *dev,
static int ds3231_counter_cancel_alarm(struct device *dev,
uint8_t id)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
int rv = 0;
@ -556,7 +556,7 @@ static int set_alarm(struct device *dev,
uint8_t id,
const struct maxim_ds3231_alarm *cp)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
uint8_t addr;
uint8_t len;
@ -605,7 +605,7 @@ int maxim_ds3231_set_alarm(struct device *dev,
uint8_t id,
const struct maxim_ds3231_alarm *cp)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
k_sem_take(&data->lock, K_FOREVER);
@ -618,7 +618,7 @@ int maxim_ds3231_set_alarm(struct device *dev,
int maxim_ds3231_check_alarms(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct register_map *rp = &data->registers;
uint8_t mask = (MAXIM_DS3231_ALARM1 | MAXIM_DS3231_ALARM2);
@ -640,7 +640,7 @@ int maxim_ds3231_check_alarms(struct device *dev)
static int check_handled_alarms(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct register_map *rp = &data->registers;
uint8_t mask = (MAXIM_DS3231_ALARM1 | MAXIM_DS3231_ALARM2);
@ -750,7 +750,7 @@ static void sqw_worker(struct k_work *work)
static int read_time(struct device *dev,
time_t *time)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
uint8_t addr = 0;
@ -768,7 +768,7 @@ static int read_time(struct device *dev,
static int ds3231_counter_get_value(struct device *dev,
uint32_t *ticks)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
time_t time = 0;
k_sem_take(&data->lock, K_FOREVER);
@ -787,7 +787,7 @@ static int ds3231_counter_get_value(struct device *dev,
static void sync_finish(struct device *dev,
int rc)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
struct sys_notify *notify = NULL;
struct k_poll_signal *signal = NULL;
@ -818,7 +818,7 @@ static void sync_finish(struct device *dev,
static void sync_prep_read(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
int rc = sc_ctrl(dev, 0U, MAXIM_DS3231_REG_CTRL_INTCN
| MAXIM_DS3231_REG_CTRL_RS_Msk);
@ -832,7 +832,7 @@ static void sync_prep_read(struct device *dev)
static void sync_finish_read(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
time_t time = 0;
(void)read_time(dev, &time);
@ -853,7 +853,7 @@ static void sync_timer_handler(struct k_timer *tmr)
static void sync_prep_write(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
uint32_t syncclock = maxim_ds3231_read_syncclock(dev);
uint32_t offset = syncclock - data->new_sp.syncclock;
uint32_t syncclock_Hz = maxim_ds3231_syncclock_frequency(dev);
@ -885,7 +885,7 @@ static void sync_prep_write(struct device *dev)
static void sync_finish_write(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
time_t when = data->new_sp.rtc.tv_sec;
struct tm tm;
@ -987,7 +987,7 @@ static void isw_gpio_callback(struct device *port,
int z_impl_maxim_ds3231_get_syncpoint(struct device *dev,
struct maxim_ds3231_syncpoint *syncpoint)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
int rv = 0;
k_sem_take(&data->lock, K_FOREVER);
@ -1007,7 +1007,7 @@ int z_impl_maxim_ds3231_get_syncpoint(struct device *dev,
int maxim_ds3231_synchronize(struct device *dev,
struct sys_notify *notify)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
int rv = 0;
if (notify == NULL) {
@ -1045,7 +1045,7 @@ out:
int z_impl_maxim_ds3231_req_syncpoint(struct device *dev,
struct k_poll_signal *sig)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
int rv = 0;
if (data->isw == NULL) {
@ -1079,7 +1079,7 @@ int maxim_ds3231_set(struct device *dev,
const struct maxim_ds3231_syncpoint *syncpoint,
struct sys_notify *notify)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
int rv = 0;
if ((syncpoint == NULL)
@ -1117,7 +1117,7 @@ out:
static int ds3231_init(struct device *dev)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct ds3231_config *cfg = dev->config;
struct device *i2c = device_get_binding(cfg->bus_name);
int rc;
@ -1213,7 +1213,7 @@ int ds3231_counter_set_alarm(struct device *dev,
uint8_t id,
const struct counter_alarm_cfg *alarm_cfg)
{
struct ds3231_data *data = dev->driver_data;
struct ds3231_data *data = dev->data;
const struct register_map *rp = &data->registers;
const struct ds3231_config *cfg = dev->config;
time_t when;

View file

@ -38,7 +38,7 @@ struct dtmr_cmsdk_apb_dev_data {
static int dtmr_cmsdk_apb_start(struct device *dev)
{
const struct dtmr_cmsdk_apb_cfg * const cfg = dev->config;
struct dtmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct dtmr_cmsdk_apb_dev_data *data = dev->data;
/* Set the timer reload to count */
cfg->dtimer->timer1load = data->load;
@ -62,7 +62,7 @@ static int dtmr_cmsdk_apb_stop(struct device *dev)
static int dtmr_cmsdk_apb_get_value(struct device *dev, uint32_t *ticks)
{
const struct dtmr_cmsdk_apb_cfg * const cfg = dev->config;
struct dtmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct dtmr_cmsdk_apb_dev_data *data = dev->data;
*ticks = data->load - cfg->dtimer->timer1value;
return 0;
@ -72,7 +72,7 @@ static int dtmr_cmsdk_apb_set_top_value(struct device *dev,
const struct counter_top_cfg *top_cfg)
{
const struct dtmr_cmsdk_apb_cfg * const cfg = dev->config;
struct dtmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct dtmr_cmsdk_apb_dev_data *data = dev->data;
data->top_callback = top_cfg->callback;
data->top_user_data = top_cfg->user_data;
@ -104,7 +104,7 @@ static int dtmr_cmsdk_apb_set_top_value(struct device *dev,
static uint32_t dtmr_cmsdk_apb_get_top_value(struct device *dev)
{
struct dtmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct dtmr_cmsdk_apb_dev_data *data = dev->data;
uint32_t ticks = data->load;
@ -130,7 +130,7 @@ static const struct counter_driver_api dtmr_cmsdk_apb_api = {
static void dtmr_cmsdk_apb_isr(void *arg)
{
struct device *dev = (struct device *)arg;
struct dtmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct dtmr_cmsdk_apb_dev_data *data = dev->data;
const struct dtmr_cmsdk_apb_cfg * const cfg = dev->config;
cfg->dtimer->timer1intclr = DUALTIMER_INTCLR;

View file

@ -40,7 +40,7 @@ static int tmr_cmsdk_apb_start(struct device *dev)
{
const struct tmr_cmsdk_apb_cfg * const cfg =
dev->config;
struct tmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct tmr_cmsdk_apb_dev_data *data = dev->data;
/* Set the timer reload to count */
cfg->timer->reload = data->load;
@ -64,7 +64,7 @@ static int tmr_cmsdk_apb_get_value(struct device *dev, uint32_t *ticks)
{
const struct tmr_cmsdk_apb_cfg * const cfg =
dev->config;
struct tmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct tmr_cmsdk_apb_dev_data *data = dev->data;
/* Get Counter Value */
*ticks = data->load - cfg->timer->value;
@ -76,7 +76,7 @@ static int tmr_cmsdk_apb_set_top_value(struct device *dev,
{
const struct tmr_cmsdk_apb_cfg * const cfg =
dev->config;
struct tmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct tmr_cmsdk_apb_dev_data *data = dev->data;
/* Counter is always reset when top value is updated. */
if (top_cfg->flags & COUNTER_TOP_CFG_DONT_RESET) {
@ -103,7 +103,7 @@ static int tmr_cmsdk_apb_set_top_value(struct device *dev,
static uint32_t tmr_cmsdk_apb_get_top_value(struct device *dev)
{
struct tmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct tmr_cmsdk_apb_dev_data *data = dev->data;
uint32_t ticks = data->load;
@ -130,7 +130,7 @@ static const struct counter_driver_api tmr_cmsdk_apb_api = {
static void tmr_cmsdk_apb_isr(void *arg)
{
struct device *dev = (struct device *)arg;
struct tmr_cmsdk_apb_dev_data *data = dev->driver_data;
struct tmr_cmsdk_apb_dev_data *data = dev->data;
const struct tmr_cmsdk_apb_cfg * const cfg =
dev->config;

View file

@ -43,7 +43,7 @@ static int ataes132a_send_command(struct device *dev, uint8_t opcode,
uint8_t *nresponse)
{
int retry_count = 0;
struct ataes132a_device_data *data = dev->driver_data;
struct ataes132a_device_data *data = dev->data;
const struct ataes132a_device_config *cfg = dev->config;
uint8_t count;
uint8_t status;
@ -166,7 +166,7 @@ static int ataes132a_send_command(struct device *dev, uint8_t opcode,
int ataes132a_init(struct device *dev)
{
struct ataes132a_device_data *ataes132a = dev->driver_data;
struct ataes132a_device_data *ataes132a = dev->data;
const struct ataes132a_device_config *cfg = dev->config;
uint32_t i2c_cfg;
@ -197,7 +197,7 @@ int ataes132a_aes_ccm_decrypt(struct device *dev,
uint8_t *nonce_buf)
{
uint8_t command_mode = 0x0;
struct ataes132a_device_data *data = dev->driver_data;
struct ataes132a_device_data *data = dev->data;
uint8_t out_len;
uint8_t in_buf_len;
uint8_t return_code;
@ -397,7 +397,7 @@ int ataes132a_aes_ccm_encrypt(struct device *dev,
uint8_t *mac_count)
{
uint8_t command_mode = 0x0;
struct ataes132a_device_data *data = dev->driver_data;
struct ataes132a_device_data *data = dev->data;
uint8_t buf_len;
uint8_t out_len;
uint8_t return_code;
@ -581,7 +581,7 @@ int ataes132a_aes_ecb_block(struct device *dev,
uint8_t key_id,
struct cipher_pkt *pkt)
{
struct ataes132a_device_data *data = dev->driver_data;
struct ataes132a_device_data *data = dev->data;
uint8_t buf_len;
uint8_t out_len;
uint8_t return_code;
@ -797,7 +797,7 @@ static int ataes132a_session_setup(struct device *dev, struct cipher_ctx *ctx,
enum cipher_op op_type)
{
uint8_t key_id = *((uint8_t *)ctx->key.handle);
struct ataes132a_device_data *data = dev->driver_data;
struct ataes132a_device_data *data = dev->data;
const struct ataes132a_device_config *cfg = dev->config;
uint8_t config;

View file

@ -140,7 +140,7 @@ static inline int burst_write_i2c(struct device *dev, uint16_t dev_addr,
uint16_t start_addr, uint8_t *buf,
uint8_t num_bytes)
{
const struct i2c_driver_api *api = dev->driver_api;
const struct i2c_driver_api *api = dev->api;
uint8_t addr_buffer[2];
struct i2c_msg msg[2];
@ -162,7 +162,7 @@ static inline int burst_read_i2c(struct device *dev, uint16_t dev_addr,
uint16_t start_addr, uint8_t *buf,
uint8_t num_bytes)
{
const struct i2c_driver_api *api = dev->driver_api;
const struct i2c_driver_api *api = dev->api;
uint8_t addr_buffer[2];
struct i2c_msg msg[2];

View file

@ -31,7 +31,7 @@ struct crypto_stm32_session {
((const struct crypto_stm32_config *const)(dev)->config)
#define CRYPTO_STM32_DATA(dev) \
((struct crypto_stm32_data *const)(dev)->driver_data)
((struct crypto_stm32_data *const)(dev)->data)
#define CRYPTO_STM32_SESSN(ctx) \
((struct crypto_stm32_session *const)(ctx)->drv_sessn_state)

View file

@ -28,7 +28,7 @@ static int mcux_dac_channel_setup(struct device *dev,
const struct dac_channel_cfg *channel_cfg)
{
const struct mcux_dac_config *config = dev->config;
struct mcux_dac_data *data = dev->driver_data;
struct mcux_dac_data *data = dev->data;
dac_config_t dac_config;
if (channel_cfg->channel_id != 0) {
@ -55,7 +55,7 @@ static int mcux_dac_channel_setup(struct device *dev,
static int mcux_dac_write_value(struct device *dev, uint8_t channel, uint32_t value)
{
const struct mcux_dac_config *config = dev->config;
struct mcux_dac_data *data = dev->driver_data;
struct mcux_dac_data *data = dev->data;
if (!data->configured) {
LOG_ERR("channel not initialized");

View file

@ -29,7 +29,7 @@ static int mcux_dac32_channel_setup(struct device *dev,
const struct dac_channel_cfg *channel_cfg)
{
const struct mcux_dac32_config *config = dev->config;
struct mcux_dac32_data *data = dev->driver_data;
struct mcux_dac32_data *data = dev->data;
dac32_config_t dac32_config;
if (channel_cfg->channel_id != 0) {
@ -60,7 +60,7 @@ static int mcux_dac32_channel_setup(struct device *dev,
static int mcux_dac32_write_value(struct device *dev, uint8_t channel, uint32_t value)
{
const struct mcux_dac32_config *config = dev->config;
struct mcux_dac32_data *data = dev->driver_data;
struct mcux_dac32_data *data = dev->data;
if (!data->configured) {
LOG_ERR("channel not initialized");

View file

@ -53,7 +53,7 @@ struct dac_stm32_data {
static int dac_stm32_write_value(struct device *dev,
uint8_t channel, uint32_t value)
{
struct dac_stm32_data *data = dev->driver_data;
struct dac_stm32_data *data = dev->data;
const struct dac_stm32_cfg *cfg = dev->config;
if (channel - STM32_FIRST_CHANNEL >= data->channel_count ||
@ -76,7 +76,7 @@ static int dac_stm32_write_value(struct device *dev,
static int dac_stm32_channel_setup(struct device *dev,
const struct dac_channel_cfg *channel_cfg)
{
struct dac_stm32_data *data = dev->driver_data;
struct dac_stm32_data *data = dev->data;
const struct dac_stm32_cfg *cfg = dev->config;
if ((channel_cfg->channel_id - STM32_FIRST_CHANNEL >=

View file

@ -17,7 +17,7 @@ static struct dummy_display_data dummy_display_data;
static int dummy_display_init(struct device *dev)
{
struct dummy_display_data *disp_data =
(struct dummy_display_data *)dev->driver_data;
(struct dummy_display_data *)dev->data;
disp_data->current_pixel_format = PIXEL_FORMAT_ARGB_8888;
@ -87,7 +87,7 @@ static void dummy_display_get_capabilities(const struct device *dev,
struct display_capabilities *capabilities)
{
struct dummy_display_data *disp_data =
(struct dummy_display_data *)dev->driver_data;
(struct dummy_display_data *)dev->data;
memset(capabilities, 0, sizeof(struct display_capabilities));
capabilities->x_resolution = CONFIG_DUMMY_DISPLAY_X_RES;
@ -105,7 +105,7 @@ static int dummy_display_set_pixel_format(const struct device *dev,
const enum display_pixel_format pixel_format)
{
struct dummy_display_data *disp_data =
(struct dummy_display_data *)dev->driver_data;
(struct dummy_display_data *)dev->data;
disp_data->current_pixel_format = pixel_format;
return 0;

View file

@ -49,7 +49,7 @@ static void ili9340_exit_sleep(struct ili9340_data *data)
static int ili9340_init(struct device *dev)
{
struct ili9340_data *data = (struct ili9340_data *)dev->driver_data;
struct ili9340_data *data = (struct ili9340_data *)dev->data;
LOG_DBG("Initializing display driver");
@ -137,7 +137,7 @@ static int ili9340_write(const struct device *dev, const uint16_t x,
const struct display_buffer_descriptor *desc,
const void *buf)
{
struct ili9340_data *data = (struct ili9340_data *)dev->driver_data;
struct ili9340_data *data = (struct ili9340_data *)dev->data;
const uint8_t *write_data_start = (uint8_t *) buf;
struct spi_buf tx_buf;
struct spi_buf_set tx_bufs;
@ -196,7 +196,7 @@ static void *ili9340_get_framebuffer(const struct device *dev)
static int ili9340_display_blanking_off(const struct device *dev)
{
struct ili9340_data *data = (struct ili9340_data *)dev->driver_data;
struct ili9340_data *data = (struct ili9340_data *)dev->data;
LOG_DBG("Turning display blanking off");
ili9340_transmit(data, ILI9340_CMD_DISPLAY_ON, NULL, 0);
@ -205,7 +205,7 @@ static int ili9340_display_blanking_off(const struct device *dev)
static int ili9340_display_blanking_on(const struct device *dev)
{
struct ili9340_data *data = (struct ili9340_data *)dev->driver_data;
struct ili9340_data *data = (struct ili9340_data *)dev->data;
LOG_DBG("Turning display blanking on");
ili9340_transmit(data, ILI9340_CMD_DISPLAY_OFF, NULL, 0);

View file

@ -45,7 +45,7 @@ static int mcux_elcdif_write(const struct device *dev, const uint16_t x,
const void *buf)
{
const struct mcux_elcdif_config *config = dev->config;
struct mcux_elcdif_data *data = dev->driver_data;
struct mcux_elcdif_data *data = dev->data;
uint8_t write_idx = data->write_idx;
uint8_t read_idx = !write_idx;
@ -168,7 +168,7 @@ static void mcux_elcdif_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct mcux_elcdif_config *config = dev->config;
struct mcux_elcdif_data *data = dev->driver_data;
struct mcux_elcdif_data *data = dev->data;
uint32_t status;
status = ELCDIF_GetInterruptStatus(config->base);
@ -180,7 +180,7 @@ static void mcux_elcdif_isr(void *arg)
static int mcux_elcdif_init(struct device *dev)
{
const struct mcux_elcdif_config *config = dev->config;
struct mcux_elcdif_data *data = dev->driver_data;
struct mcux_elcdif_data *data = dev->data;
int i;
elcdif_rgb_mode_config_t rgb_mode = config->rgb_mode;

View file

@ -29,7 +29,7 @@ static struct sdl_display_data sdl_display_data;
static int sdl_display_init(struct device *dev)
{
struct sdl_display_data *disp_data =
(struct sdl_display_data *)dev->driver_data;
(struct sdl_display_data *)dev->data;
LOG_DBG("Initializing display driver");
memset(disp_data, 0, sizeof(struct sdl_display_data));
@ -219,7 +219,7 @@ static int sdl_display_write(const struct device *dev, const uint16_t x,
SDL_Rect rect;
struct sdl_display_data *disp_data =
(struct sdl_display_data *)dev->driver_data;
(struct sdl_display_data *)dev->data;
LOG_DBG("Writing %dx%d (w,h) bitmap @ %dx%d (x,y)", desc->width,
desc->height, x, y);
@ -278,7 +278,7 @@ static int sdl_display_read(const struct device *dev, const uint16_t x,
void *buf)
{
struct sdl_display_data *disp_data =
(struct sdl_display_data *)dev->driver_data;
(struct sdl_display_data *)dev->data;
SDL_Rect rect;
rect.x = x;
@ -305,7 +305,7 @@ static void *sdl_display_get_framebuffer(const struct device *dev)
static int sdl_display_blanking_off(const struct device *dev)
{
struct sdl_display_data *disp_data =
(struct sdl_display_data *)dev->driver_data;
(struct sdl_display_data *)dev->data;
LOG_DBG("Turning display blacking off");
@ -321,7 +321,7 @@ static int sdl_display_blanking_off(const struct device *dev)
static int sdl_display_blanking_on(const struct device *dev)
{
struct sdl_display_data *disp_data =
(struct sdl_display_data *)dev->driver_data;
(struct sdl_display_data *)dev->data;
LOG_DBG("Turning display blanking on");
@ -348,7 +348,7 @@ static void sdl_display_get_capabilities(
const struct device *dev, struct display_capabilities *capabilities)
{
struct sdl_display_data *disp_data =
(struct sdl_display_data *)dev->driver_data;
(struct sdl_display_data *)dev->data;
memset(capabilities, 0, sizeof(struct display_capabilities));
capabilities->x_resolution = CONFIG_SDL_DISPLAY_X_RES;
@ -368,7 +368,7 @@ static int sdl_display_set_pixel_format(const struct device *dev,
const enum display_pixel_format pixel_format)
{
struct sdl_display_data *disp_data =
(struct sdl_display_data *)dev->driver_data;
(struct sdl_display_data *)dev->data;
switch (pixel_format) {
case PIXEL_FORMAT_ARGB_8888:

View file

@ -115,7 +115,7 @@ static void st7789v_reset_display(struct st7789v_data *data)
static int st7789v_blanking_on(const struct device *dev)
{
struct st7789v_data *driver = (struct st7789v_data *)dev->driver_data;
struct st7789v_data *driver = (struct st7789v_data *)dev->data;
st7789v_transmit(driver, ST7789V_CMD_DISP_OFF, NULL, 0);
return 0;
@ -123,7 +123,7 @@ static int st7789v_blanking_on(const struct device *dev)
static int st7789v_blanking_off(const struct device *dev)
{
struct st7789v_data *driver = (struct st7789v_data *)dev->driver_data;
struct st7789v_data *driver = (struct st7789v_data *)dev->data;
st7789v_transmit(driver, ST7789V_CMD_DISP_ON, NULL, 0);
return 0;
@ -161,7 +161,7 @@ static int st7789v_write(const struct device *dev,
const struct display_buffer_descriptor *desc,
const void *buf)
{
struct st7789v_data *data = (struct st7789v_data *)dev->driver_data;
struct st7789v_data *data = (struct st7789v_data *)dev->data;
const uint8_t *write_data_start = (uint8_t *) buf;
struct spi_buf tx_buf;
struct spi_buf_set tx_bufs;
@ -223,7 +223,7 @@ static int st7789v_set_contrast(const struct device *dev,
static void st7789v_get_capabilities(const struct device *dev,
struct display_capabilities *capabilities)
{
struct st7789v_data *data = (struct st7789v_data *)dev->driver_data;
struct st7789v_data *data = (struct st7789v_data *)dev->data;
memset(capabilities, 0, sizeof(struct display_capabilities));
capabilities->x_resolution = data->width;
@ -336,7 +336,7 @@ static void st7789v_lcd_init(struct st7789v_data *p_st7789v)
static int st7789v_init(struct device *dev)
{
struct st7789v_data *data = (struct st7789v_data *)dev->driver_data;
struct st7789v_data *data = (struct st7789v_data *)dev->data;
data->spi_dev = device_get_binding(DT_INST_BUS_LABEL(0));
if (data->spi_dev == NULL) {
@ -412,7 +412,7 @@ static int st7789v_pm_control(struct device *dev, uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)
{
int ret = 0;
struct st7789v_data *data = (struct st7789v_data *)dev->driver_data;
struct st7789v_data *data = (struct st7789v_data *)dev->data;
switch (ctrl_command) {
case DEVICE_PM_SET_POWER_STATE:

View file

@ -112,7 +112,7 @@ static inline void gd7965_busy_wait(struct gd7965_data *driver)
static int gd7965_update_display(const struct device *dev)
{
struct gd7965_data *driver = dev->driver_data;
struct gd7965_data *driver = dev->data;
LOG_DBG("Trigger update sequence");
if (gd7965_write_cmd(driver, GD7965_CMD_DRF, NULL, 0)) {
@ -126,7 +126,7 @@ static int gd7965_update_display(const struct device *dev)
static int gd7965_blanking_off(const struct device *dev)
{
struct gd7965_data *driver = dev->driver_data;
struct gd7965_data *driver = dev->data;
if (blanking_on) {
/* Update EPD pannel in normal mode */
@ -152,7 +152,7 @@ static int gd7965_write(const struct device *dev, const uint16_t x, const uint16
const struct display_buffer_descriptor *desc,
const void *buf)
{
struct gd7965_data *driver = dev->driver_data;
struct gd7965_data *driver = dev->data;
uint16_t x_end_idx = x + desc->width - 1;
uint16_t y_end_idx = y + desc->height - 1;
uint8_t ptl[GD7965_PTL_REG_LENGTH] = {0};
@ -314,7 +314,7 @@ static int gd7965_clear_and_write_buffer(struct device *dev,
static int gd7965_controller_init(struct device *dev)
{
struct gd7965_data *driver = dev->driver_data;
struct gd7965_data *driver = dev->data;
uint8_t tmp[GD7965_TRES_REG_LENGTH];
gpio_pin_set(driver->reset, GD7965_RESET_PIN, 1);
@ -392,7 +392,7 @@ static int gd7965_controller_init(struct device *dev)
static int gd7965_init(struct device *dev)
{
struct gd7965_data *driver = dev->driver_data;
struct gd7965_data *driver = dev->data;
LOG_DBG("");

View file

@ -106,7 +106,7 @@ void glcd_print(struct device *port, char *data, uint32_t size)
{
const struct glcd_driver * const rom = (const struct glcd_driver *)
port->config;
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
uint8_t buf[] = { GLCD_CMD_SET_CGRAM_ADDR, 0 };
int i;
@ -121,7 +121,7 @@ void glcd_cursor_pos_set(struct device *port, uint8_t col, uint8_t row)
{
const struct glcd_driver * const rom = (const struct glcd_driver *)
port->config;
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
unsigned char data[2];
@ -142,7 +142,7 @@ void glcd_clear(struct device *port)
{
const struct glcd_driver * const rom = (const struct glcd_driver *)
port->config;
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
uint8_t clear[] = { 0, GLCD_CMD_SCREEN_CLEAR };
i2c_write(dev->i2c, clear, sizeof(clear), rom->lcd_addr);
@ -155,7 +155,7 @@ void glcd_display_state_set(struct device *port, uint8_t opt)
{
const struct glcd_driver * const rom = (const struct glcd_driver *)
port->config;
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
uint8_t data[] = { 0, 0 };
dev->display_switch = opt;
@ -170,7 +170,7 @@ void glcd_display_state_set(struct device *port, uint8_t opt)
uint8_t glcd_display_state_get(struct device *port)
{
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
return dev->display_switch;
}
@ -179,7 +179,7 @@ uint8_t glcd_display_state_get(struct device *port)
void glcd_input_state_set(struct device *port, uint8_t opt)
{
const struct glcd_driver * const rom = port->config;
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
uint8_t data[] = { 0, 0 };
dev->input_set = opt;
@ -193,7 +193,7 @@ void glcd_input_state_set(struct device *port, uint8_t opt)
uint8_t glcd_input_state_get(struct device *port)
{
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
return dev->input_set;
}
@ -213,7 +213,7 @@ void glcd_color_select(struct device *port, uint8_t color)
void glcd_color_set(struct device *port, uint8_t r, uint8_t g, uint8_t b)
{
struct glcd_data * const dev = port->driver_data;
struct glcd_data * const dev = port->data;
rgb_reg_set(dev->i2c, REGISTER_R, r);
rgb_reg_set(dev->i2c, REGISTER_G, g);
@ -224,7 +224,7 @@ void glcd_color_set(struct device *port, uint8_t r, uint8_t g, uint8_t b)
void glcd_function_set(struct device *port, uint8_t opt)
{
const struct glcd_driver * const rom = port->config;
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
uint8_t data[] = { 0, 0 };
dev->function = opt;
@ -239,7 +239,7 @@ void glcd_function_set(struct device *port, uint8_t opt)
uint8_t glcd_function_get(struct device *port)
{
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
return dev->function;
}
@ -247,7 +247,7 @@ uint8_t glcd_function_get(struct device *port)
int glcd_initialize(struct device *port)
{
struct glcd_data *dev = port->driver_data;
struct glcd_data *dev = port->data;
uint8_t cmd;
LOG_DBG("initialize called");

View file

@ -79,7 +79,7 @@ static inline int ssd1306_reg_update(struct ssd1306_data *driver, uint8_t reg,
static inline int ssd1306_set_panel_orientation(struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
uint8_t cmd_buf[] = {
SSD1306_CONTROL_BYTE_CMD,
(SSD1306_PANEL_SEGMENT_REMAP ?
@ -97,7 +97,7 @@ static inline int ssd1306_set_panel_orientation(struct device *dev)
static inline int ssd1306_set_timing_setting(struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
uint8_t cmd_buf[] = {
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_CLOCK_DIV_RATIO,
@ -119,7 +119,7 @@ static inline int ssd1306_set_timing_setting(struct device *dev)
static inline int ssd1306_set_hardware_config(struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
uint8_t cmd_buf[] = {
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_START_LINE,
@ -143,7 +143,7 @@ static inline int ssd1306_set_hardware_config(struct device *dev)
static inline int ssd1306_set_charge_pump(const struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
uint8_t cmd_buf[] = {
#if defined(CONFIG_SSD1306_DEFAULT)
SSD1306_CONTROL_BYTE_CMD,
@ -167,7 +167,7 @@ static inline int ssd1306_set_charge_pump(const struct device *dev)
static int ssd1306_resume(const struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
/* set display on */
return ssd1306_reg_write(driver, SSD1306_CONTROL_LAST_BYTE_CMD,
SSD1306_DISPLAY_ON);
@ -175,7 +175,7 @@ static int ssd1306_resume(const struct device *dev)
static int ssd1306_suspend(const struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
/* set display on */
return ssd1306_reg_write(driver, SSD1306_CONTROL_LAST_BYTE_CMD,
SSD1306_DISPLAY_OFF);
@ -185,7 +185,7 @@ static int ssd1306_write(const struct device *dev, const uint16_t x, const uint1
const struct display_buffer_descriptor *desc,
const void *buf)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
size_t buf_len;
if (desc->pitch < desc->width) {
@ -309,7 +309,7 @@ static int ssd1306_set_brightness(const struct device *dev,
static int ssd1306_set_contrast(const struct device *dev, const uint8_t contrast)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
uint8_t cmd_buf[] = {
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_CONTRAST_CTRL,
@ -352,7 +352,7 @@ static int ssd1306_set_pixel_format(const struct device *dev,
static int ssd1306_init_device(struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
uint8_t cmd_buf[] = {
SSD1306_CONTROL_BYTE_CMD,
@ -412,7 +412,7 @@ static int ssd1306_init_device(struct device *dev)
static int ssd1306_init(struct device *dev)
{
struct ssd1306_data *driver = dev->driver_data;
struct ssd1306_data *driver = dev->data;
LOG_DBG("");

View file

@ -210,7 +210,7 @@ static int ssd16xx_blanking_on(const struct device *dev)
static int ssd16xx_update_display(const struct device *dev)
{
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
int err;
err = ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_CTRL2,
@ -228,7 +228,7 @@ static int ssd16xx_write(const struct device *dev, const uint16_t x,
const struct display_buffer_descriptor *desc,
const void *buf)
{
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
int err;
size_t buf_len;
uint16_t x_start;
@ -387,7 +387,7 @@ static int ssd16xx_set_pixel_format(const struct device *dev,
static int ssd16xx_clear_cntlr_mem(struct device *dev, uint8_t ram_cmd,
bool update)
{
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
uint8_t clear_page[EPD_PANEL_WIDTH];
uint16_t panel_h = EPD_PANEL_HEIGHT /
EPD_PANEL_NUMOF_ROWS_PER_PAGE;
@ -435,7 +435,7 @@ static int ssd16xx_clear_cntlr_mem(struct device *dev, uint8_t ram_cmd,
static inline int ssd16xx_load_ws_from_otp(struct device *dev)
{
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
uint8_t tmp[2];
#if DT_INST_NODE_HAS_PROP(0, tssv)
@ -503,7 +503,7 @@ static inline int ssd16xx_load_ws_from_otp(struct device *dev)
static int ssd16xx_load_ws_initial(struct device *dev)
{
#if DT_INST_NODE_HAS_PROP(0, lut_initial)
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
if (ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_LUT,
ssd16xx_lut_initial,
@ -522,7 +522,7 @@ static int ssd16xx_load_ws_initial(struct device *dev)
static int ssd16xx_load_ws_default(struct device *dev)
{
#if DT_INST_NODE_HAS_PROP(0, lut_default)
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
if (ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_LUT,
ssd16xx_lut_default,
@ -541,7 +541,7 @@ static int ssd16xx_controller_init(struct device *dev)
int err;
uint8_t tmp[3];
size_t len;
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
LOG_DBG("");
@ -643,7 +643,7 @@ static int ssd16xx_controller_init(struct device *dev)
static int ssd16xx_init(struct device *dev)
{
struct ssd16xx_data *driver = dev->driver_data;
struct ssd16xx_data *driver = dev->data;
LOG_DBG("");

View file

@ -35,7 +35,7 @@ LOG_MODULE_REGISTER(dma_dw);
#define DW_CFG_LOW_DEF 0x0
#define DEV_NAME(dev) ((dev)->name)
#define DEV_DATA(dev) ((struct dw_dma_dev_data *const)(dev)->driver_data)
#define DEV_DATA(dev) ((struct dw_dma_dev_data *const)(dev)->data)
#define DEV_CFG(dev) \
((const struct dw_dma_dev_cfg *const)(dev)->config)

View file

@ -50,7 +50,7 @@ struct dma_mcux_edma_data {
#define DEV_CFG(dev) \
((const struct dma_mcux_edma_config *const)dev->config)
#define DEV_DATA(dev) ((struct dma_mcux_edma_data *)dev->driver_data)
#define DEV_DATA(dev) ((struct dma_mcux_edma_data *)dev->data)
#define DEV_BASE(dev) ((DMA_Type *)DEV_CFG(dev)->base)
#define DEV_DMAMUX_BASE(dev) ((DMAMUX_Type *)DEV_CFG(dev)->dmamux_base)

View file

@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(dma_pl330);
((const struct dma_pl330_config *const)(dev)->config)
#define DEV_DATA(dev) \
((struct dma_pl330_dev_data *const)(dev)->driver_data)
((struct dma_pl330_dev_data *const)(dev)->data)
#define BYTE_WIDTH(burst_size) (1 << (burst_size))

View file

@ -27,7 +27,7 @@ struct dma_sam0_data {
};
#define DEV_DATA(dev) \
((struct dma_sam0_data *const)(dev)->driver_data)
((struct dma_sam0_data *const)(dev)->data)
/* Handles DMA interrupts and dispatches to the individual channel */

View file

@ -49,7 +49,7 @@ struct sam_xdmac_dev_data {
#define DEV_CFG(dev) \
((const struct sam_xdmac_dev_cfg *const)(dev)->config)
#define DEV_DATA(dev) \
((struct sam_xdmac_dev_data *const)(dev)->driver_data)
((struct sam_xdmac_dev_data *const)(dev)->data)
static void sam_xdmac_isr(void *arg)
{

View file

@ -57,7 +57,7 @@ static void dma_stm32_clear_stream_irq(struct device *dev, uint32_t id)
static void dma_stm32_irq_handler(void *arg)
{
struct device *dev = arg;
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
const struct dma_stm32_config *config = dev->config;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
struct dma_stm32_stream *stream;
@ -240,7 +240,7 @@ static int dma_stm32_configure(struct device *dev, uint32_t id,
struct dma_config *config)
#endif /* CONFIG_DMAMUX_STM32 */
{
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
struct dma_stm32_stream *stream = &data->streams[id - STREAM_OFFSET];
const struct dma_stm32_config *dev_config =
dev->config;
@ -479,7 +479,7 @@ static int dma_stm32_reload(struct device *dev, uint32_t id,
{
const struct dma_stm32_config *config = dev->config;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
struct dma_stm32_stream *stream = &data->streams[id - STREAM_OFFSET];
/* give channel from index 0 */
@ -526,7 +526,7 @@ static int dma_stm32_start(struct device *dev, uint32_t id)
{
const struct dma_stm32_config *config = dev->config;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
/* give channel from index 0 */
id = id - STREAM_OFFSET;
@ -549,7 +549,7 @@ int dma_stm32_stop(struct device *dev, uint32_t id)
static int dma_stm32_stop(struct device *dev, uint32_t id)
#endif /* CONFIG_DMAMUX_STM32 */
{
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
struct dma_stm32_stream *stream = &data->streams[id - STREAM_OFFSET];
const struct dma_stm32_config *config =
dev->config;
@ -582,7 +582,7 @@ struct k_mem_block block;
static int dma_stm32_init(struct device *dev)
{
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
const struct dma_stm32_config *config = dev->config;
struct device *clk =
device_get_binding(STM32_CLOCK_CONTROL_NAME);
@ -625,7 +625,7 @@ static int dma_stm32_get_status(struct device *dev, uint32_t id,
{
const struct dma_stm32_config *config = dev->config;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
struct dma_stm32_stream *stream;
/* give channel from index 0 */
@ -694,7 +694,7 @@ DMA_INIT(0);
static void dma_stm32_config_irq_0(struct device *dev)
{
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
IRQ_INIT(0, 0);
IRQ_INIT(0, 1);
@ -720,7 +720,7 @@ DMA_INIT(1);
static void dma_stm32_config_irq_1(struct device *dev)
{
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_data *data = dev->data;
IRQ_INIT(1, 0);
IRQ_INIT(1, 1);

View file

@ -29,7 +29,7 @@ int dmamux_stm32_configure(struct device *dev, uint32_t id,
struct dma_config *config)
{
/* device is the dmamux, id is the dmamux channel from 0 */
struct dmamux_stm32_data *data = dev->driver_data;
struct dmamux_stm32_data *data = dev->data;
const struct dmamux_stm32_config *dev_config = dev->config;
/*
@ -78,7 +78,7 @@ int dmamux_stm32_configure(struct device *dev, uint32_t id,
int dmamux_stm32_start(struct device *dev, uint32_t id)
{
const struct dmamux_stm32_config *dev_config = dev->config;
struct dmamux_stm32_data *data = dev->driver_data;
struct dmamux_stm32_data *data = dev->data;
/* check if this channel is valid */
if (id >= dev_config->channel_nb) {
@ -98,7 +98,7 @@ int dmamux_stm32_start(struct device *dev, uint32_t id)
int dmamux_stm32_stop(struct device *dev, uint32_t id)
{
const struct dmamux_stm32_config *dev_config = dev->config;
struct dmamux_stm32_data *data = dev->driver_data;
struct dmamux_stm32_data *data = dev->data;
/* check if this channel is valid */
if (id >= dev_config->channel_nb) {
@ -119,7 +119,7 @@ int dmamux_stm32_reload(struct device *dev, uint32_t id,
uint32_t src, uint32_t dst, size_t size)
{
const struct dmamux_stm32_config *dev_config = dev->config;
struct dmamux_stm32_data *data = dev->driver_data;
struct dmamux_stm32_data *data = dev->data;
/* check if this channel is valid */
if (id >= dev_config->channel_nb) {
@ -139,7 +139,7 @@ int dmamux_stm32_reload(struct device *dev, uint32_t id,
static int dmamux_stm32_init(struct device *dev)
{
struct dmamux_stm32_data *data = dev->driver_data;
struct dmamux_stm32_data *data = dev->data;
const struct dmamux_stm32_config *config = dev->config;
struct device *clk =
device_get_binding(STM32_CLOCK_CONTROL_NAME);

View file

@ -66,7 +66,7 @@ struct eeprom_at2x_data {
static inline int eeprom_at2x_write_protect(struct device *dev)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
if (!data->wp_gpio_dev) {
return 0;
@ -78,7 +78,7 @@ static inline int eeprom_at2x_write_protect(struct device *dev)
static inline int eeprom_at2x_write_enable(struct device *dev)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
if (!data->wp_gpio_dev) {
return 0;
@ -91,7 +91,7 @@ static int eeprom_at2x_read(struct device *dev, off_t offset, void *buf,
size_t len)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
int err;
if (!len) {
@ -140,7 +140,7 @@ static int eeprom_at2x_write(struct device *dev, off_t offset, const void *buf,
size_t len)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
const uint8_t *pbuf = buf;
int ret;
@ -203,7 +203,7 @@ static int eeprom_at24_read(struct device *dev, off_t offset, void *buf,
size_t len)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
int64_t timeout;
uint8_t addr[2];
int err;
@ -237,7 +237,7 @@ static int eeprom_at24_write(struct device *dev, off_t offset,
const void *buf, size_t len)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
int count = eeprom_at2x_limit_write_count(dev, offset, len);
uint8_t block[config->addr_width / 8 + count];
int64_t timeout;
@ -282,7 +282,7 @@ static int eeprom_at24_write(struct device *dev, off_t offset,
#ifdef CONFIG_EEPROM_AT25
static int eeprom_at25_rdsr(struct device *dev, uint8_t *status)
{
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
uint8_t rdsr[2] = { EEPROM_AT25_RDSR, 0 };
uint8_t sr[2];
int err;
@ -343,7 +343,7 @@ static int eeprom_at25_read(struct device *dev, off_t offset, void *buf,
size_t len)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
size_t cmd_len = 1 + config->addr_width / 8;
uint8_t cmd[4] = { EEPROM_AT25_READ, 0, 0, 0 };
uint8_t *paddr;
@ -407,7 +407,7 @@ static int eeprom_at25_read(struct device *dev, off_t offset, void *buf,
static int eeprom_at25_wren(struct device *dev)
{
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
uint8_t cmd = EEPROM_AT25_WREN;
const struct spi_buf tx_buf = {
.buf = &cmd,
@ -425,7 +425,7 @@ static int eeprom_at25_write(struct device *dev, off_t offset,
const void *buf, size_t len)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
int count = eeprom_at2x_limit_write_count(dev, offset, len);
uint8_t cmd[4] = { EEPROM_AT25_WRITE, 0, 0, 0 };
size_t cmd_len = 1 + config->addr_width / 8;
@ -485,7 +485,7 @@ static int eeprom_at25_write(struct device *dev, off_t offset,
static int eeprom_at2x_init(struct device *dev)
{
const struct eeprom_at2x_config *config = dev->config;
struct eeprom_at2x_data *data = dev->driver_data;
struct eeprom_at2x_data *data = dev->data;
int err;
k_mutex_init(&data->lock);

View file

@ -45,7 +45,7 @@ DEVICE_DECLARE(entropy_cc13xx_cc26xx);
static inline struct entropy_cc13xx_cc26xx_data *
get_dev_data(struct device *dev)
{
return dev->driver_data;
return dev->data;
}
static void start_trng(struct entropy_cc13xx_cc26xx_data *data)

View file

@ -98,7 +98,7 @@ struct entropy_nrf5_dev_data {
static struct entropy_nrf5_dev_data entropy_nrf5_data;
#define DEV_DATA(dev) \
((struct entropy_nrf5_dev_data *)(dev)->driver_data)
((struct entropy_nrf5_dev_data *)(dev)->data)
static int random_byte_get(void)
{

View file

@ -29,7 +29,7 @@ struct entropy_stm32_rng_dev_data {
};
#define DEV_DATA(dev) \
((struct entropy_stm32_rng_dev_data *)(dev)->driver_data)
((struct entropy_stm32_rng_dev_data *)(dev)->data)
#define DEV_CFG(dev) \
((const struct entropy_stm32_rng_dev_cfg *)(dev)->config)

View file

@ -476,7 +476,7 @@ static int espi_xec_receive_vwire(struct device *dev,
static int espi_xec_send_oob(struct device *dev, struct espi_oob_packet *pckt)
{
int ret;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
uint8_t err_mask = MCHP_ESPI_OOB_TX_STS_IBERR |
MCHP_ESPI_OOB_TX_STS_OVRUN |
MCHP_ESPI_OOB_TX_STS_BADREQ;
@ -525,7 +525,7 @@ static int espi_xec_receive_oob(struct device *dev,
int ret;
uint8_t err_mask = MCHP_ESPI_OOB_RX_STS_IBERR |
MCHP_ESPI_OOB_RX_STS_OVRUN;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
if (ESPI_OOB_REGS->TX_STS & err_mask) {
return -EIO;
@ -559,7 +559,7 @@ static int espi_xec_flash_read(struct device *dev,
struct espi_flash_packet *pckt)
{
int ret;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
uint32_t err_mask = MCHP_ESPI_FC_STS_IBERR |
MCHP_ESPI_FC_STS_FAIL |
MCHP_ESPI_FC_STS_OVFL |
@ -612,7 +612,7 @@ static int espi_xec_flash_write(struct device *dev,
MCHP_ESPI_FC_STS_FAIL |
MCHP_ESPI_FC_STS_BADREQ;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
LOG_DBG("%s", __func__);
@ -657,7 +657,7 @@ static int espi_xec_flash_write(struct device *dev,
static int espi_xec_manage_callback(struct device *dev,
struct espi_callback *callback, bool set)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
return espi_manage_callback(&data->callbacks, callback, set);
}
@ -723,7 +723,7 @@ static void espi_bus_init(struct device *dev)
static void espi_rst_isr(struct device *dev)
{
uint8_t rst_sts;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { ESPI_BUS_RESET, 0, 0 };
rst_sts = ESPI_CAP_REGS->ERST_STS;
@ -857,7 +857,7 @@ static void espi_pc_isr(struct device *dev)
static void espi_vwire_chanel_isr(struct device *dev)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
const struct espi_xec_config *config = dev->config;
struct espi_event evt = { .evt_type = ESPI_BUS_EVENT_CHANNEL_READY,
.evt_details = ESPI_CHANNEL_VWIRE,
@ -881,7 +881,7 @@ static void espi_vwire_chanel_isr(struct device *dev)
static void espi_oob_down_isr(struct device *dev)
{
uint32_t status;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
status = ESPI_OOB_REGS->RX_STS;
@ -900,7 +900,7 @@ static void espi_oob_down_isr(struct device *dev)
static void espi_oob_up_isr(struct device *dev)
{
uint32_t status;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { .evt_type = ESPI_BUS_EVENT_CHANNEL_READY,
.evt_details = ESPI_CHANNEL_OOB,
.evt_data = 0
@ -933,7 +933,7 @@ static void espi_oob_up_isr(struct device *dev)
static void espi_flash_isr(struct device *dev)
{
uint32_t status;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { .evt_type = ESPI_BUS_EVENT_CHANNEL_READY,
.evt_details = ESPI_CHANNEL_FLASH,
.evt_data = 0,
@ -967,7 +967,7 @@ static void espi_flash_isr(struct device *dev)
static void vw_pltrst_isr(struct device *dev)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { ESPI_BUS_EVENT_VWIRE_RECEIVED,
ESPI_VWIRE_SIGNAL_PLTRST, 0
};
@ -990,7 +990,7 @@ static void vw_pltrst_isr(struct device *dev)
static void notify_system_state(struct device *dev,
enum espi_vwire_signal signal)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { ESPI_BUS_EVENT_VWIRE_RECEIVED, 0, 0 };
uint8_t status = 0;
@ -1013,7 +1013,7 @@ static void notify_host_warning(struct device *dev,
if (!IS_ENABLED(CONFIG_ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE)) {
struct espi_xec_data *data =
(struct espi_xec_data *)(dev->driver_data);
(struct espi_xec_data *)(dev->data);
struct espi_event evt = {ESPI_BUS_EVENT_VWIRE_RECEIVED, 0, 0 };
evt.evt_details = signal;
@ -1078,7 +1078,7 @@ static void vw_sus_slp_a_isr(struct device *dev)
static void ibf_isr(struct device *dev)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { ESPI_BUS_PERIPHERAL_NOTIFICATION,
ESPI_PERIPHERAL_HOST_IO, ESPI_PERIPHERAL_NODATA
};
@ -1089,7 +1089,7 @@ static void ibf_isr(struct device *dev)
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO_PVT
static void ibf_pvt_isr(struct device *dev)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = {
.evt_type = ESPI_BUS_PERIPHERAL_NOTIFICATION,
.evt_details = ESPI_PERIPHERAL_HOST_IO_PVT,
@ -1102,7 +1102,7 @@ static void ibf_pvt_isr(struct device *dev)
static void ibf_kbc_isr(struct device *dev)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
/* The high byte contains information from the host,
* and the lower byte speficies if the host sent
@ -1123,7 +1123,7 @@ static void ibf_kbc_isr(struct device *dev)
static void port80_isr(struct device *dev)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { ESPI_BUS_PERIPHERAL_NOTIFICATION,
(ESPI_PERIPHERAL_INDEX_0 << 16) | ESPI_PERIPHERAL_DEBUG_PORT80,
ESPI_PERIPHERAL_NODATA
@ -1135,7 +1135,7 @@ static void port80_isr(struct device *dev)
static void port81_isr(struct device *dev)
{
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
struct espi_event evt = { ESPI_BUS_PERIPHERAL_NOTIFICATION,
(ESPI_PERIPHERAL_INDEX_1 << 16) | ESPI_PERIPHERAL_DEBUG_PORT80,
ESPI_PERIPHERAL_NODATA
@ -1291,7 +1291,7 @@ DEVICE_AND_API_INIT(espi_xec_0, DT_INST_LABEL(0),
static int espi_xec_init(struct device *dev)
{
const struct espi_xec_config *config = dev->config;
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
data->plt_rst_asserted = 0;

View file

@ -110,7 +110,7 @@ static int e1000_tx(struct e1000_dev *dev, void *buf, size_t len)
static int e1000_send(struct device *device, struct net_pkt *pkt)
{
struct e1000_dev *dev = device->driver_data;
struct e1000_dev *dev = device->data;
size_t len = net_pkt_get_len(pkt);
if (net_pkt_read(pkt, dev->txb, len)) {
@ -162,7 +162,7 @@ out:
static void e1000_isr(struct device *device)
{
struct e1000_dev *dev = device->driver_data;
struct e1000_dev *dev = device->data;
uint32_t icr = ior32(dev, ICR); /* Cleared upon read */
uint16_t vlan_tag = NET_VLAN_TAG_UNSPEC;
@ -215,7 +215,7 @@ DEVICE_DECLARE(eth_e1000);
int e1000_probe(struct device *device)
{
const pcie_bdf_t bdf = PCIE_BDF(0, 3, 0);
struct e1000_dev *dev = device->driver_data;
struct e1000_dev *dev = device->data;
uint32_t ral, rah;
uintptr_t phys_addr;
size_t size;
@ -269,7 +269,7 @@ int e1000_probe(struct device *device)
static void e1000_iface_init(struct net_if *iface)
{
struct e1000_dev *dev = net_if_get_device(iface)->driver_data;
struct e1000_dev *dev = net_if_get_device(iface)->data;
/* For VLAN, this value is only used to get the correct L2 driver.
* The iface pointer in device context should contain the main

View file

@ -30,7 +30,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
static int eth_enc28j60_soft_reset(struct device *dev)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2] = { ENC28J60_SPI_SC, 0xFF };
const struct spi_buf tx_buf = {
.buf = buf,
@ -46,7 +46,7 @@ static int eth_enc28j60_soft_reset(struct device *dev)
static void eth_enc28j60_set_bank(struct device *dev, uint16_t reg_addr)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -81,7 +81,7 @@ static void eth_enc28j60_set_bank(struct device *dev, uint16_t reg_addr)
static void eth_enc28j60_write_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -101,7 +101,7 @@ static void eth_enc28j60_write_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_read_reg(struct device *dev, uint16_t reg_addr,
uint8_t *value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[3];
const struct spi_buf tx_buf = {
.buf = buf,
@ -140,7 +140,7 @@ static void eth_enc28j60_read_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_set_eth_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -161,7 +161,7 @@ static void eth_enc28j60_set_eth_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_clear_eth_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -181,7 +181,7 @@ static void eth_enc28j60_clear_eth_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_write_mem(struct device *dev, uint8_t *data_buffer,
uint16_t buf_len)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[1] = { ENC28J60_SPI_WBM };
struct spi_buf tx_buf[2] = {
{
@ -223,7 +223,7 @@ static void eth_enc28j60_write_mem(struct device *dev, uint8_t *data_buffer,
static void eth_enc28j60_read_mem(struct device *dev, uint8_t *data_buffer,
uint16_t buf_len)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[1] = { ENC28J60_SPI_RBM };
const struct spi_buf tx_buf = {
.buf = buf,
@ -350,7 +350,7 @@ static void eth_enc28j60_init_buffers(struct device *dev)
static void eth_enc28j60_init_mac(struct device *dev)
{
const struct eth_enc28j60_config *config = dev->config;
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t data_macon;
eth_enc28j60_set_bank(dev, ENC28J60_REG_MACON1);
@ -433,7 +433,7 @@ static struct net_if *get_iface(struct eth_enc28j60_runtime *ctx,
static int eth_enc28j60_tx(struct device *dev, struct net_pkt *pkt)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint16_t tx_bufaddr = ENC28J60_TXSTART;
uint16_t len = net_pkt_get_len(pkt);
uint8_t per_packet_control;
@ -507,7 +507,7 @@ static int eth_enc28j60_tx(struct device *dev, struct net_pkt *pkt)
static int eth_enc28j60_rx(struct device *dev, uint16_t *vlan_tag)
{
const struct eth_enc28j60_config *config = dev->config;
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint16_t lengthfr;
uint8_t counter;
@ -659,7 +659,7 @@ done:
static void eth_enc28j60_rx_thread(struct device *dev)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint16_t vlan_tag = NET_VLAN_TAG_UNSPEC;
uint8_t int_stat;
@ -691,7 +691,7 @@ static enum ethernet_hw_caps eth_enc28j60_get_capabilities(struct device *dev)
static void eth_enc28j60_iface_init(struct net_if *iface)
{
struct device *dev = net_if_get_device(iface);
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
net_if_set_link_addr(iface, context->mac_address,
sizeof(context->mac_address),
@ -718,7 +718,7 @@ static const struct ethernet_api api_funcs = {
static int eth_enc28j60_init(struct device *dev)
{
const struct eth_enc28j60_config *config = dev->config;
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
/* SPI config */
context->spi_cfg.operation = SPI_WORD_SET(8);

View file

@ -25,7 +25,7 @@ LOG_MODULE_REGISTER(ethdrv, CONFIG_ETHERNET_LOG_LEVEL);
static void enc424j600_write_sbc(struct device *dev, uint8_t cmd)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint8_t buf[2] = { cmd, 0xFF };
const struct spi_buf tx_buf = {
.buf = buf,
@ -42,7 +42,7 @@ static void enc424j600_write_sbc(struct device *dev, uint8_t cmd)
static void enc424j600_write_sfru(struct device *dev, uint8_t addr,
uint16_t value)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint8_t buf[4];
const struct spi_buf tx_buf = {
.buf = buf,
@ -64,7 +64,7 @@ static void enc424j600_write_sfru(struct device *dev, uint8_t addr,
static void enc424j600_read_sfru(struct device *dev, uint8_t addr,
uint16_t *value)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint8_t buf[4];
const struct spi_buf tx_buf = {
.buf = buf,
@ -97,7 +97,7 @@ static void enc424j600_read_sfru(struct device *dev, uint8_t addr,
static void enc424j600_modify_sfru(struct device *dev, uint8_t opcode,
uint16_t addr, uint16_t value)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint8_t buf[4];
const struct spi_buf tx_buf = {
.buf = buf,
@ -156,7 +156,7 @@ static void enc424j600_read_phy(struct device *dev, uint16_t addr, uint16_t *dat
static void enc424j600_write_mem(struct device *dev, uint8_t opcode,
uint8_t *data_buffer, uint16_t buf_len)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint8_t buf[1] = { opcode };
const struct spi_buf tx_buf[2] = {
{
@ -182,7 +182,7 @@ static void enc424j600_write_mem(struct device *dev, uint8_t opcode,
static void enc424j600_read_mem(struct device *dev, uint8_t opcode,
uint8_t *data_buffer, uint16_t buf_len)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint8_t buf[1] = { opcode };
const struct spi_buf tx_buf = {
.buf = buf,
@ -304,7 +304,7 @@ static void enc424j600_setup_mac(struct device *dev)
static int enc424j600_tx(struct device *dev, struct net_pkt *pkt)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint16_t len = net_pkt_get_len(pkt);
struct net_buf *frag;
uint16_t tmp;
@ -343,7 +343,7 @@ static int enc424j600_tx(struct device *dev, struct net_pkt *pkt)
static int enc424j600_rx(struct device *dev)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
const struct enc424j600_config *config = dev->config;
uint8_t info[ENC424J600_RSV_SIZE + ENC424J600_PTR_NXP_PKT_SIZE];
struct net_buf *pkt_buf = NULL;
@ -441,7 +441,7 @@ done:
static void enc424j600_rx_thread(struct device *dev)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint16_t eir;
uint16_t estat;
uint8_t counter;
@ -503,7 +503,7 @@ static enum ethernet_hw_caps enc424j600_get_capabilities(struct device *dev)
static void enc424j600_iface_init(struct net_if *iface)
{
struct device *dev = net_if_get_device(iface);
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
net_if_set_link_addr(iface, context->mac_address,
sizeof(context->mac_address),
@ -517,7 +517,7 @@ static void enc424j600_iface_init(struct net_if *iface)
static int enc424j600_start_device(struct device *dev)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint16_t tmp;
if (!context->suspended) {
@ -547,7 +547,7 @@ static int enc424j600_start_device(struct device *dev)
static int enc424j600_stop_device(struct device *dev)
{
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint16_t tmp;
if (context->suspended) {
@ -597,7 +597,7 @@ static const struct ethernet_api api_funcs = {
static int enc424j600_init(struct device *dev)
{
const struct enc424j600_config *config = dev->config;
struct enc424j600_runtime *context = dev->driver_data;
struct enc424j600_runtime *context = dev->data;
uint8_t retries = ENC424J600_DEFAULT_NUMOF_RETRIES;
uint16_t tmp;

View file

@ -98,7 +98,7 @@ struct eth_gecko_dev_data {
#define DEV_CFG(dev) \
((const struct eth_gecko_dev_cfg *)(dev)->config)
#define DEV_DATA(dev) \
((struct eth_gecko_dev_data *)(dev)->driver_data)
((struct eth_gecko_dev_data *)(dev)->data)
/* PHY Management pins */
#define PIN_PHY_MDC {DT_INST_PROP_BY_IDX(0, location_phy_mdc, 1), \

View file

@ -85,7 +85,7 @@ static int eth_tx(struct device *dev, struct net_pkt *pkt)
{
int key;
uint16_t len;
struct eth_liteeth_dev_data *context = dev->driver_data;
struct eth_liteeth_dev_data *context = dev->data;
key = irq_lock();
@ -116,7 +116,7 @@ static int eth_tx(struct device *dev, struct net_pkt *pkt)
static void eth_rx(struct device *port)
{
struct net_pkt *pkt;
struct eth_liteeth_dev_data *context = port->driver_data;
struct eth_liteeth_dev_data *context = port->data;
unsigned int key, r;
uint16_t len = 0;
@ -191,7 +191,7 @@ static const struct eth_liteeth_config eth_config = {
static void eth_iface_init(struct net_if *iface)
{
struct device *port = net_if_get_device(iface);
struct eth_liteeth_dev_data *context = port->driver_data;
struct eth_liteeth_dev_data *context = port->data;
static bool init_done;
/* initialize only once */

View file

@ -200,7 +200,7 @@ void eth_mcux_phy_stop(struct eth_context *context);
static int eth_mcux_device_pm_control(struct device *dev, uint32_t command,
void *context, device_pm_cb cb, void *arg)
{
struct eth_context *eth_ctx = (struct eth_context *)dev->driver_data;
struct eth_context *eth_ctx = (struct eth_context *)dev->data;
int ret = 0;
if (!eth_ctx->clock_dev) {
@ -712,7 +712,7 @@ static bool eth_get_ptp_data(struct net_if *iface, struct net_pkt *pkt,
static int eth_tx(struct device *dev, struct net_pkt *pkt)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
uint16_t total_len = net_pkt_get_len(pkt);
status_t status;
unsigned int imask;
@ -774,7 +774,7 @@ static int eth_tx(struct device *dev, struct net_pkt *pkt)
static void eth_rx(struct device *iface)
{
struct eth_context *context = iface->driver_data;
struct eth_context *context = iface->data;
uint16_t vlan_tag = NET_VLAN_TAG_UNSPEC;
uint32_t frame_length = 0U;
struct net_pkt *pkt;
@ -930,7 +930,7 @@ static void eth_callback(ENET_Type *base, enet_handle_t *handle,
enet_event_t event, void *param)
{
struct device *iface = param;
struct eth_context *context = iface->driver_data;
struct eth_context *context = iface->data;
switch (event) {
case kENET_RxEvent:
@ -1002,7 +1002,7 @@ static void generate_eth1_unique_mac(uint8_t *mac_addr)
static void eth_mcux_init(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
enet_config_t enet_config;
uint32_t sys_clock;
enet_buffer_config_t buffer_config = {
@ -1093,7 +1093,7 @@ static void eth_mcux_init(struct device *dev)
static int eth_init(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
#if defined(CONFIG_PTP_CLOCK_MCUX)
ts_tx_rd = 0;
@ -1138,7 +1138,7 @@ static void net_if_mcast_cb(struct net_if *iface,
bool is_joined)
{
struct device *dev = net_if_get_device(iface);
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
struct net_eth_addr mac_addr;
net_eth_ipv6_mcast_to_mac_addr(addr, &mac_addr);
@ -1154,7 +1154,7 @@ static void net_if_mcast_cb(struct net_if *iface,
static void eth_iface_init(struct net_if *iface)
{
struct device *dev = net_if_get_device(iface);
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
#if defined(CONFIG_NET_IPV6)
static struct net_if_mcast_monitor mon;
@ -1199,7 +1199,7 @@ static enum ethernet_hw_caps eth_mcux_get_capabilities(struct device *dev)
#if defined(CONFIG_PTP_CLOCK_MCUX)
static struct device *eth_mcux_get_ptp_clock(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
return context->ptp_clock;
}
@ -1218,7 +1218,7 @@ static const struct ethernet_api api_funcs = {
static void eth_mcux_ptp_isr(void *p)
{
struct device *dev = p;
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
ENET_Ptp1588TimerIRQHandler(context->base, &context->enet_handle);
}
@ -1228,7 +1228,7 @@ static void eth_mcux_ptp_isr(void *p)
static void eth_mcux_dispacher_isr(void *p)
{
struct device *dev = p;
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
uint32_t EIR = ENET_GetInterruptStatus(context->base);
int irq_lock_key = irq_lock();
@ -1251,7 +1251,7 @@ static void eth_mcux_dispacher_isr(void *p)
static void eth_mcux_rx_isr(void *p)
{
struct device *dev = p;
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
ENET_ReceiveIRQHandler(context->base, &context->enet_handle);
}
@ -1261,7 +1261,7 @@ static void eth_mcux_rx_isr(void *p)
static void eth_mcux_tx_isr(void *p)
{
struct device *dev = p;
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
ENET_TransmitIRQHandler(context->base, &context->enet_handle);
}
@ -1271,7 +1271,7 @@ static void eth_mcux_tx_isr(void *p)
static void eth_mcux_error_isr(void *p)
{
struct device *dev = p;
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
uint32_t pending = ENET_GetInterruptStatus(context->base);
if (pending & ENET_EIR_MII_MASK) {
@ -1401,7 +1401,7 @@ static struct ptp_context ptp_mcux_0_context;
static int ptp_clock_mcux_set(struct device *dev, struct net_ptp_time *tm)
{
struct ptp_context *ptp_context = dev->driver_data;
struct ptp_context *ptp_context = dev->data;
struct eth_context *context = ptp_context->eth_context;
enet_ptp_time_t enet_time;
@ -1414,7 +1414,7 @@ static int ptp_clock_mcux_set(struct device *dev, struct net_ptp_time *tm)
static int ptp_clock_mcux_get(struct device *dev, struct net_ptp_time *tm)
{
struct ptp_context *ptp_context = dev->driver_data;
struct ptp_context *ptp_context = dev->data;
struct eth_context *context = ptp_context->eth_context;
enet_ptp_time_t enet_time;
@ -1427,7 +1427,7 @@ static int ptp_clock_mcux_get(struct device *dev, struct net_ptp_time *tm)
static int ptp_clock_mcux_adjust(struct device *dev, int increment)
{
struct ptp_context *ptp_context = dev->driver_data;
struct ptp_context *ptp_context = dev->data;
struct eth_context *context = ptp_context->eth_context;
int key, ret;
@ -1455,7 +1455,7 @@ static int ptp_clock_mcux_adjust(struct device *dev, int increment)
static int ptp_clock_mcux_rate_adjust(struct device *dev, float ratio)
{
const int hw_inc = NSEC_PER_SEC / CONFIG_ETH_MCUX_PTP_CLOCK_SRC_HZ;
struct ptp_context *ptp_context = dev->driver_data;
struct ptp_context *ptp_context = dev->data;
struct eth_context *context = ptp_context->eth_context;
int corr;
int32_t mul;
@ -1513,8 +1513,8 @@ static const struct ptp_clock_driver_api api = {
static int ptp_mcux_init(struct device *port)
{
struct device *eth_dev = DEVICE_GET(eth_mcux_0);
struct eth_context *context = eth_dev->driver_data;
struct ptp_context *ptp_context = port->driver_data;
struct eth_context *context = eth_dev->data;
struct ptp_context *ptp_context = port->data;
context->ptp_clock = port;
ptp_context->eth_context = context;

View file

@ -176,7 +176,7 @@ static void update_gptp(struct net_if *iface, struct net_pkt *pkt,
static int eth_send(struct device *dev, struct net_pkt *pkt)
{
struct eth_context *ctx = dev->driver_data;
struct eth_context *ctx = dev->data;
int count = net_pkt_get_len(pkt);
int ret;
@ -394,7 +394,7 @@ static void create_rx_handler(struct eth_context *ctx)
static void eth_iface_init(struct net_if *iface)
{
struct eth_context *ctx = net_if_get_device(iface)->driver_data;
struct eth_context *ctx = net_if_get_device(iface)->data;
struct net_linkaddr *ll_addr = eth_get_mac(ctx);
/* The iface pointer in context should contain the main interface
@ -479,7 +479,7 @@ enum ethernet_hw_caps eth_posix_native_get_capabilities(struct device *dev)
#if defined(CONFIG_ETH_NATIVE_POSIX_PTP_CLOCK)
static struct device *eth_get_ptp_clock(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
return context->ptp_clock;
}
@ -488,7 +488,7 @@ static struct device *eth_get_ptp_clock(struct device *dev)
#if defined(CONFIG_NET_STATISTICS_ETHERNET)
static struct net_stats_eth *get_stats(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
return &(context->stats);
}
@ -502,7 +502,7 @@ static int set_config(struct device *dev,
if (IS_ENABLED(CONFIG_NET_PROMISCUOUS_MODE) &&
type == ETHERNET_CONFIG_TYPE_PROMISC_MODE) {
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
if (config->promisc_mode) {
if (context->promisc_mode) {
@ -541,7 +541,7 @@ static int vlan_setup(struct device *dev, struct net_if *iface,
static int eth_start_device(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
int ret;
context->status = true;
@ -555,7 +555,7 @@ static int eth_start_device(struct device *dev)
static int eth_stop_device(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
context->status = false;
@ -652,8 +652,8 @@ static const struct ptp_clock_driver_api api = {
static int ptp_init(struct device *port)
{
struct device *eth_dev = DEVICE_GET(eth_native_posix);
struct eth_context *context = eth_dev->driver_data;
struct ptp_context *ptp_context = port->driver_data;
struct eth_context *context = eth_dev->data;
struct ptp_context *ptp_context = port->data;
context->ptp_clock = port;
ptp_context->eth_context = context;

View file

@ -2382,7 +2382,7 @@ static struct ptp_context ptp_gmac_0_context;
static int ptp_clock_sam_gmac_set(struct device *dev,
struct net_ptp_time *tm)
{
struct ptp_context *ptp_context = dev->driver_data;
struct ptp_context *ptp_context = dev->data;
const struct eth_sam_dev_cfg *const cfg = DEV_CFG(ptp_context->eth_dev);
Gmac *gmac = cfg->regs;
@ -2396,7 +2396,7 @@ static int ptp_clock_sam_gmac_set(struct device *dev,
static int ptp_clock_sam_gmac_get(struct device *dev,
struct net_ptp_time *tm)
{
struct ptp_context *ptp_context = dev->driver_data;
struct ptp_context *ptp_context = dev->data;
const struct eth_sam_dev_cfg *const cfg = DEV_CFG(ptp_context->eth_dev);
Gmac *gmac = cfg->regs;
@ -2408,7 +2408,7 @@ static int ptp_clock_sam_gmac_get(struct device *dev,
static int ptp_clock_sam_gmac_adjust(struct device *dev, int increment)
{
struct ptp_context *ptp_context = dev->driver_data;
struct ptp_context *ptp_context = dev->data;
const struct eth_sam_dev_cfg *const cfg = DEV_CFG(ptp_context->eth_dev);
Gmac *gmac = cfg->regs;
@ -2440,8 +2440,8 @@ static const struct ptp_clock_driver_api ptp_api = {
static int ptp_gmac_init(struct device *port)
{
struct device *eth_dev = DEVICE_GET(eth0_sam_gmac);
struct eth_sam_dev_data *dev_data = eth_dev->driver_data;
struct ptp_context *ptp_context = port->driver_data;
struct eth_sam_dev_data *dev_data = eth_dev->data;
struct ptp_context *ptp_context = port->data;
dev_data->ptp_clock = port;
ptp_context->eth_dev = eth_dev;

View file

@ -283,6 +283,6 @@ struct eth_sam_dev_data {
#define DEV_CFG(dev) \
((const struct eth_sam_dev_cfg *const)(dev)->config)
#define DEV_DATA(dev) \
((struct eth_sam_dev_data *const)(dev)->driver_data)
((struct eth_sam_dev_data *const)(dev)->data)
#endif /* ZEPHYR_DRIVERS_ETHERNET_ETH_SAM_GMAC_PRIV_H_ */

View file

@ -421,7 +421,7 @@ static enum ethernet_hw_caps eth_smsc911x_get_capabilities(struct device *dev)
#if defined(CONFIG_NET_STATISTICS_ETHERNET)
static struct net_stats_eth *get_stats(struct device *dev)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
return &context->stats;
}
@ -430,7 +430,7 @@ static struct net_stats_eth *get_stats(struct device *dev)
static void eth_initialize(struct net_if *iface)
{
struct device *dev = net_if_get_device(iface);
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
LOG_DBG("eth_initialize");
@ -555,7 +555,7 @@ static int smsc_read_rx_fifo(struct net_pkt *pkt, uint32_t len)
static struct net_pkt *smsc_recv_pkt(struct device *dev, uint32_t pkt_size)
{
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
struct net_pkt *pkt;
uint32_t rem_size;
@ -595,7 +595,7 @@ static struct net_pkt *smsc_recv_pkt(struct device *dev, uint32_t pkt_size)
static void eth_smsc911x_isr(struct device *dev)
{
uint32_t int_status = SMSC9220->INT_STS;
struct eth_context *context = dev->driver_data;
struct eth_context *context = dev->data;
LOG_DBG("%s: INT_STS=%x INT_EN=%x", __func__,
int_status, SMSC9220->INT_EN);

View file

@ -9,7 +9,7 @@
#define ETH_STELLARIS_PRIV_H_
#define DEV_DATA(dev) \
((struct eth_stellaris_runtime *)(dev)->driver_data)
((struct eth_stellaris_runtime *)(dev)->data)
#define DEV_CFG(dev) \
((const struct eth_stellaris_config *const)(dev)->config)
/*

View file

@ -49,6 +49,6 @@ struct eth_stm32_hal_dev_data {
#define DEV_CFG(dev) \
((const struct eth_stm32_hal_dev_cfg *)(dev)->config)
#define DEV_DATA(dev) \
((struct eth_stm32_hal_dev_data *)(dev)->driver_data)
((struct eth_stm32_hal_dev_data *)(dev)->data)
#endif /* ZEPHYR_DRIVERS_ETHERNET_ETH_STM32_HAL_PRIV_H_ */

View file

@ -32,7 +32,7 @@ static const struct flash_parameters flash_gecko_parameters = {
#define DEV_NAME(dev) ((dev)->name)
#define DEV_DATA(dev) \
((struct flash_gecko_data *const)(dev)->driver_data)
((struct flash_gecko_data *const)(dev)->data)
static bool write_range_is_valid(off_t offset, uint32_t size);
static bool read_range_is_valid(off_t offset, uint32_t size);

View file

@ -9,7 +9,7 @@
static int flash_get_page_info(struct device *dev, off_t offs,
bool use_addr, struct flash_pages_info *info)
{
const struct flash_driver_api *api = dev->driver_api;
const struct flash_driver_api *api = dev->api;
const struct flash_pages_layout *layout;
size_t page_count = 0;
off_t group_offs = 0;
@ -66,7 +66,7 @@ int z_impl_flash_get_page_info_by_idx(struct device *dev, uint32_t page_index,
size_t z_impl_flash_get_page_count(struct device *dev)
{
const struct flash_driver_api *api = dev->driver_api;
const struct flash_driver_api *api = dev->api;
const struct flash_pages_layout *layout;
size_t layout_size;
size_t count = 0;
@ -83,7 +83,7 @@ size_t z_impl_flash_get_page_count(struct device *dev)
void flash_page_foreach(struct device *dev, flash_page_cb cb, void *data)
{
const struct flash_driver_api *api = dev->driver_api;
const struct flash_driver_api *api = dev->api;
const struct flash_pages_layout *layout;
struct flash_pages_info page_info;
size_t block, num_blocks, page = 0, i;

View file

@ -55,7 +55,7 @@ static const struct flash_parameters flash_sam_parameters = {
((const struct flash_sam_dev_cfg *const)(dev)->config)
#define DEV_DATA(dev) \
((struct flash_sam_dev_data *const)(dev)->driver_data)
((struct flash_sam_dev_data *const)(dev)->data)
static inline void flash_sam_sem_take(struct device *dev)

View file

@ -72,14 +72,14 @@ static const struct flash_parameters flash_sam0_parameters = {
static inline void flash_sam0_sem_take(struct device *dev)
{
struct flash_sam0_data *ctx = dev->driver_data;
struct flash_sam0_data *ctx = dev->data;
k_sem_take(&ctx->sem, K_FOREVER);
}
static inline void flash_sam0_sem_give(struct device *dev)
{
struct flash_sam0_data *ctx = dev->driver_data;
struct flash_sam0_data *ctx = dev->data;
k_sem_give(&ctx->sem);
}
@ -193,7 +193,7 @@ static int flash_sam0_erase_row(struct device *dev, off_t offset)
static int flash_sam0_commit(struct device *dev)
{
struct flash_sam0_data *ctx = dev->driver_data;
struct flash_sam0_data *ctx = dev->data;
int err;
int page;
off_t offset = ctx->offset;
@ -224,7 +224,7 @@ static int flash_sam0_commit(struct device *dev)
static int flash_sam0_write(struct device *dev, off_t offset,
const void *data, size_t len)
{
struct flash_sam0_data *ctx = dev->driver_data;
struct flash_sam0_data *ctx = dev->data;
const uint8_t *pdata = data;
off_t addr;
int err;
@ -407,7 +407,7 @@ flash_sam0_get_parameters(const struct device *dev)
static int flash_sam0_init(struct device *dev)
{
struct flash_sam0_data *ctx = dev->driver_data;
struct flash_sam0_data *ctx = dev->data;
k_sem_init(&ctx->sem, 1, 1);

View file

@ -41,7 +41,7 @@ struct flash_stm32_priv {
/* as flash node property 'write-block-size' */
#endif
#define FLASH_STM32_PRIV(dev) ((struct flash_stm32_priv *)((dev)->driver_data))
#define FLASH_STM32_PRIV(dev) ((struct flash_stm32_priv *)((dev)->data))
#define FLASH_STM32_REGS(dev) (FLASH_STM32_PRIV(dev)->regs)
#ifdef CONFIG_FLASH_PAGE_LAYOUT

View file

@ -232,7 +232,7 @@ static inline int qspi_get_zephyr_ret_code(nrfx_err_t res)
static inline struct qspi_nor_data *get_dev_data(struct device *dev)
{
return dev->driver_data;
return dev->data;
}
static inline void qspi_lock(struct device *dev)
@ -686,7 +686,7 @@ static int qspi_nor_write(struct device *dev, off_t addr, const void *src,
return -EINVAL;
}
struct qspi_nor_data *const driver_data = dev->driver_data;
struct qspi_nor_data *const driver_data = dev->data;
const struct qspi_nor_config *params = dev->config;
if (driver_data->write_protection) {
@ -722,7 +722,7 @@ static int qspi_nor_write(struct device *dev, off_t addr, const void *src,
static int qspi_nor_erase(struct device *dev, off_t addr, size_t size)
{
struct qspi_nor_data *const driver_data = dev->driver_data;
struct qspi_nor_data *const driver_data = dev->data;
const struct qspi_nor_config *params = dev->config;
if (driver_data->write_protection) {
@ -746,7 +746,7 @@ static int qspi_nor_erase(struct device *dev, off_t addr, size_t size)
static int qspi_nor_write_protection_set(struct device *dev,
bool write_protect)
{
struct qspi_nor_data *const driver_data = dev->driver_data;
struct qspi_nor_data *const driver_data = dev->data;
int ret = 0;
struct qspi_cmd cmd = {

View file

@ -138,7 +138,7 @@ static const struct flash_parameters flash_mcux_parameters = {
static int flash_mcux_erase(struct device *dev, off_t offset, size_t len)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t addr;
status_t rc;
unsigned int key;
@ -172,7 +172,7 @@ static int flash_mcux_erase(struct device *dev, off_t offset, size_t len)
static int flash_mcux_read(struct device *dev, off_t offset,
void *data, size_t len)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t addr;
status_t rc = 0;
@ -203,7 +203,7 @@ static int flash_mcux_read(struct device *dev, off_t offset,
static int flash_mcux_write(struct device *dev, off_t offset,
const void *data, size_t len)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t addr;
status_t rc;
unsigned int key;
@ -225,7 +225,7 @@ static int flash_mcux_write(struct device *dev, off_t offset,
static int flash_mcux_write_protection(struct device *dev, bool enable)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
int rc = 0;
if (enable) {
@ -276,7 +276,7 @@ static const struct flash_driver_api flash_mcux_api = {
static int flash_mcux_init(struct device *dev)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t pflash_block_base;
status_t rc;

View file

@ -68,7 +68,7 @@ static const struct flash_parameters flash_nios2_qspi_parameters = {
static int flash_nios2_qspi_erase(struct device *dev, off_t offset, size_t len)
{
struct flash_nios2_qspi_config *flash_cfg = dev->driver_data;
struct flash_nios2_qspi_config *flash_cfg = dev->data;
alt_qspi_controller2_dev *qspi_dev = &flash_cfg->qspi_dev;
uint32_t block_offset, offset_in_block, length_to_erase;
uint32_t erase_offset = offset; /* address of next byte to erase */
@ -164,7 +164,7 @@ static int flash_nios2_qspi_write_block(struct device *dev, int block_offset,
int mem_offset, const void *data,
size_t len)
{
struct flash_nios2_qspi_config *flash_cfg = dev->driver_data;
struct flash_nios2_qspi_config *flash_cfg = dev->data;
alt_qspi_controller2_dev *qspi_dev = &flash_cfg->qspi_dev;
uint32_t buffer_offset = 0U; /* offset into data buffer to get write data */
int32_t remaining_length = len; /* length left to write */
@ -261,7 +261,7 @@ qspi_write_block_err:
static int flash_nios2_qspi_write(struct device *dev, off_t offset,
const void *data, size_t len)
{
struct flash_nios2_qspi_config *flash_cfg = dev->driver_data;
struct flash_nios2_qspi_config *flash_cfg = dev->data;
alt_qspi_controller2_dev *qspi_dev = &flash_cfg->qspi_dev;
uint32_t block_offset, offset_in_block, length_to_write;
uint32_t write_offset = offset; /* address of next byte to write */
@ -327,7 +327,7 @@ qspi_write_err:
static int flash_nios2_qspi_read(struct device *dev, off_t offset,
void *data, size_t len)
{
struct flash_nios2_qspi_config *flash_cfg = dev->driver_data;
struct flash_nios2_qspi_config *flash_cfg = dev->data;
alt_qspi_controller2_dev *qspi_dev = &flash_cfg->qspi_dev;
uint32_t buffer_offset = 0U; /* offset into data buffer to get read data */
uint32_t remaining_length = len; /* length left to read */
@ -393,7 +393,7 @@ static int flash_nios2_qspi_read(struct device *dev, off_t offset,
static int flash_nios2_qspi_write_protection(struct device *dev, bool enable)
{
struct flash_nios2_qspi_config *flash_cfg = dev->driver_data;
struct flash_nios2_qspi_config *flash_cfg = dev->data;
alt_qspi_controller2_dev *qspi_dev = &flash_cfg->qspi_dev;
uint32_t status, lock_val;
int32_t rc = 0, timeout;
@ -476,7 +476,7 @@ static const struct flash_driver_api flash_nios2_qspi_api = {
static int flash_nios2_qspi_init(struct device *dev)
{
struct flash_nios2_qspi_config *flash_cfg = dev->driver_data;
struct flash_nios2_qspi_config *flash_cfg = dev->data;
k_sem_init(&flash_cfg->sem_lock, 1, 1);
return 0;

View file

@ -44,7 +44,7 @@ static const struct flash_parameters flash_mcux_parameters = {
static int flash_mcux_erase(struct device *dev, off_t offset, size_t len)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t addr;
status_t rc;
unsigned int key;
@ -67,7 +67,7 @@ static int flash_mcux_erase(struct device *dev, off_t offset, size_t len)
static int flash_mcux_read(struct device *dev, off_t offset,
void *data, size_t len)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t addr;
/*
@ -85,7 +85,7 @@ static int flash_mcux_read(struct device *dev, off_t offset,
static int flash_mcux_write(struct device *dev, off_t offset,
const void *data, size_t len)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t addr;
status_t rc;
unsigned int key;
@ -107,7 +107,7 @@ static int flash_mcux_write(struct device *dev, off_t offset,
static int flash_mcux_write_protection(struct device *dev, bool enable)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
int rc = 0;
if (enable) {
@ -159,7 +159,7 @@ static const struct flash_driver_api flash_mcux_api = {
static int flash_mcux_init(struct device *dev)
{
struct flash_priv *priv = dev->driver_data;
struct flash_priv *priv = dev->data;
uint32_t pflash_block_base;
status_t rc;

View file

@ -85,7 +85,7 @@ static const struct flash_parameters flash_at45_parameters = {
static struct spi_flash_at45_data *get_dev_data(struct device *dev)
{
return dev->driver_data;
return dev->data;
}
static const struct spi_flash_at45_config *get_dev_config(struct device *dev)

View file

@ -18,7 +18,7 @@
#if defined(CONFIG_MULTITHREADING)
#define SYNC_INIT() k_sem_init( \
&((struct spi_flash_data *)dev->driver_data)->sem, 1, UINT_MAX)
&((struct spi_flash_data *)dev->data)->sem, 1, UINT_MAX)
#define SYNC_LOCK() k_sem_take(&driver_data->sem, K_FOREVER)
#define SYNC_UNLOCK() k_sem_give(&driver_data->sem)
#else
@ -78,7 +78,7 @@ static int spi_flash_wb_access(struct spi_flash_data *ctx,
static inline int spi_flash_wb_id(struct device *dev)
{
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
uint32_t temp_data;
uint8_t buf[3];
@ -100,7 +100,7 @@ static inline int spi_flash_wb_id(struct device *dev)
static uint8_t spi_flash_wb_reg_read(struct device *dev, uint8_t reg)
{
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
if (spi_flash_wb_access(driver_data, reg,
false, 0, &reg, 1, false)) {
@ -121,7 +121,7 @@ static inline void wait_for_flash_idle(struct device *dev)
static int spi_flash_wb_reg_write(struct device *dev, uint8_t reg)
{
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
if (spi_flash_wb_access(driver_data, reg, false, 0,
NULL, 0, true) != 0) {
@ -134,7 +134,7 @@ static int spi_flash_wb_reg_write(struct device *dev, uint8_t reg)
static int spi_flash_wb_read(struct device *dev, off_t offset, void *data,
size_t len)
{
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
int ret;
if (offset < 0) {
@ -156,7 +156,7 @@ static int spi_flash_wb_read(struct device *dev, off_t offset, void *data,
static int spi_flash_wb_write_protection_set_with_lock(struct device *dev,
bool enable, bool lock)
{
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
uint8_t reg = 0U;
int ret;
@ -190,7 +190,7 @@ static int spi_flash_wb_program_page(struct device *dev, off_t offset,
const void *data, size_t len)
{
uint8_t reg;
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
__ASSERT(len <= CONFIG_SPI_FLASH_W25QXXDV_PAGE_PROGRAM_SIZE,
"Maximum length is %d for page programming (actual:%d)",
@ -221,7 +221,7 @@ static int spi_flash_wb_write(struct device *dev, off_t offset,
off_t page_offset;
/* Cast `data` to prevent `void*` arithmetic */
const uint8_t *data_ptr = data;
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
if (offset < 0) {
return -ENOTSUP;
@ -278,7 +278,7 @@ end:
static inline int spi_flash_wb_erase_internal(struct device *dev,
off_t offset, size_t size)
{
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
bool need_offset = true;
uint8_t erase_opcode;
@ -322,7 +322,7 @@ static inline int spi_flash_wb_erase_internal(struct device *dev,
static int spi_flash_wb_erase(struct device *dev, off_t offset, size_t size)
{
struct spi_flash_data *const driver_data = dev->driver_data;
struct spi_flash_data *const driver_data = dev->data;
int ret = 0;
uint32_t new_offset = offset;
uint32_t size_remaining = size;
@ -414,7 +414,7 @@ static const struct flash_driver_api spi_flash_api = {
static int spi_flash_wb_configure(struct device *dev)
{
struct spi_flash_data *data = dev->driver_data;
struct spi_flash_data *data = dev->data;
data->spi = device_get_binding(DT_INST_BUS_LABEL(0));
if (!data->spi) {

View file

@ -93,7 +93,7 @@ static const struct flash_parameters flash_nor_parameters = {
static inline void record_entered_dpd(const struct device *const dev)
{
#if DT_INST_NODE_HAS_PROP(0, has_dpd)
struct spi_nor_data *const driver_data = dev->driver_data;
struct spi_nor_data *const driver_data = dev->data;
driver_data->ts_enter_dpd = k_uptime_get_32();
#endif
@ -105,7 +105,7 @@ static inline void record_entered_dpd(const struct device *const dev)
static inline void delay_until_exit_dpd_ok(const struct device *const dev)
{
#if DT_INST_NODE_HAS_PROP(0, has_dpd)
struct spi_nor_data *const driver_data = dev->driver_data;
struct spi_nor_data *const driver_data = dev->data;
int32_t since = (int32_t)(k_uptime_get_32() - driver_data->ts_enter_dpd);
/* If the time is negative the 32-bit counter has wrapped,
@ -147,7 +147,7 @@ static int spi_nor_access(const struct device *const dev,
uint8_t opcode, bool is_addressed, off_t addr,
void *data, size_t length, bool is_write)
{
struct spi_nor_data *const driver_data = dev->driver_data;
struct spi_nor_data *const driver_data = dev->data;
uint8_t buf[4] = {
opcode,
@ -248,7 +248,7 @@ static int exit_dpd(const struct device *const dev)
static void acquire_device(struct device *dev)
{
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
struct spi_nor_data *const driver_data = dev->driver_data;
struct spi_nor_data *const driver_data = dev->data;
k_sem_take(&driver_data->sem, K_FOREVER);
}
@ -270,7 +270,7 @@ static void release_device(struct device *dev)
}
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
struct spi_nor_data *const driver_data = dev->driver_data;
struct spi_nor_data *const driver_data = dev->data;
k_sem_give(&driver_data->sem);
}
@ -485,7 +485,7 @@ static int spi_nor_write_protection_set(struct device *dev, bool write_protect)
*/
static int spi_nor_configure(struct device *dev)
{
struct spi_nor_data *data = dev->driver_data;
struct spi_nor_data *data = dev->data;
const struct spi_nor_config *params = dev->config;
data->spi = device_get_binding(DT_INST_BUS_LABEL(0));
@ -536,7 +536,7 @@ static int spi_nor_configure(struct device *dev)
static int spi_nor_init(struct device *dev)
{
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
struct spi_nor_data *const driver_data = dev->driver_data;
struct spi_nor_data *const driver_data = dev->data;
k_sem_init(&driver_data->sem, 1, UINT_MAX);
}

View file

@ -181,7 +181,7 @@ static int gpio_cc13xx_cc26xx_manage_callback(struct device *port,
struct gpio_callback *callback,
bool set)
{
struct gpio_cc13xx_cc26xx_data *data = port->driver_data;
struct gpio_cc13xx_cc26xx_data *data = port->data;
return gpio_manage_callback(&data->callbacks, callback, set);
}
@ -196,7 +196,7 @@ DEVICE_DECLARE(gpio_cc13xx_cc26xx);
static void gpio_cc13xx_cc26xx_isr(void *arg)
{
struct device *dev = arg;
struct gpio_cc13xx_cc26xx_data *data = dev->driver_data;
struct gpio_cc13xx_cc26xx_data *data = dev->data;
uint32_t status = GPIO_getEventMultiDio(GPIO_DIO_ALL_MASK);

View file

@ -62,7 +62,7 @@ struct gpio_cc32xx_data {
#define DEV_CFG(dev) \
((const struct gpio_cc32xx_config *)(dev)->config)
#define DEV_DATA(dev) \
((struct gpio_cc32xx_data *)(dev)->driver_data)
((struct gpio_cc32xx_data *)(dev)->data)
static int gpio_cc32xx_port_set_bits_raw(struct device *port, uint32_t mask);
static int gpio_cc32xx_port_clear_bits_raw(struct device *port, uint32_t mask);

View file

@ -188,7 +188,7 @@ static void gpio_cmsdk_ahb_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config;
struct gpio_cmsdk_ahb_dev_data *data = dev->driver_data;
struct gpio_cmsdk_ahb_dev_data *data = dev->data;
uint32_t int_stat;
int_stat = cfg->port->intstatus;
@ -204,7 +204,7 @@ static int gpio_cmsdk_ahb_manage_callback(struct device *dev,
struct gpio_callback *callback,
bool set)
{
struct gpio_cmsdk_ahb_dev_data *data = dev->driver_data;
struct gpio_cmsdk_ahb_dev_data *data = dev->data;
return gpio_manage_callback(&data->gpio_cb, callback, set);
}

View file

@ -91,7 +91,7 @@ static inline void gpio_dw_clock_config(struct device *port)
clk = device_get_binding(drv);
if (clk) {
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
context->clock = clk;
}
@ -100,7 +100,7 @@ static inline void gpio_dw_clock_config(struct device *port)
static inline void gpio_dw_clock_on(struct device *port)
{
const struct gpio_dw_config *config = port->config;
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
clock_control_on(context->clock, config->clock_data);
}
@ -108,7 +108,7 @@ static inline void gpio_dw_clock_on(struct device *port)
static inline void gpio_dw_clock_off(struct device *port)
{
const struct gpio_dw_config *config = port->config;
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
clock_control_off(context->clock, config->clock_data);
}
@ -210,7 +210,7 @@ static int gpio_dw_pin_interrupt_configure(struct device *port,
gpio_pin_t pin, enum gpio_int_mode mode,
enum gpio_int_trig trig)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
const struct gpio_dw_config *config = port->config;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t port_base_addr = context->base_addr;
@ -274,7 +274,7 @@ static int gpio_dw_pin_interrupt_configure(struct device *port,
static inline void dw_pin_config(struct device *port,
uint32_t pin, int flags)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
const struct gpio_dw_config *config = port->config;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t port_base_addr = context->base_addr;
@ -341,7 +341,7 @@ static inline int gpio_dw_config(struct device *port,
static int gpio_dw_port_get_raw(struct device *port, uint32_t *value)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t port_base_addr = context->base_addr;
uint32_t ext_port = dw_get_ext_port(port_base_addr);
@ -354,7 +354,7 @@ static int gpio_dw_port_get_raw(struct device *port, uint32_t *value)
static int gpio_dw_port_set_masked_raw(struct device *port,
uint32_t mask, uint32_t value)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t port_base_addr = context->base_addr;
uint32_t data_port = dw_get_data_port(port_base_addr);
@ -369,7 +369,7 @@ static int gpio_dw_port_set_masked_raw(struct device *port,
static int gpio_dw_port_set_bits_raw(struct device *port, uint32_t mask)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t port_base_addr = context->base_addr;
uint32_t data_port = dw_get_data_port(port_base_addr);
@ -384,7 +384,7 @@ static int gpio_dw_port_set_bits_raw(struct device *port, uint32_t mask)
static int gpio_dw_port_clear_bits_raw(struct device *port, uint32_t mask)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t port_base_addr = context->base_addr;
uint32_t data_port = dw_get_data_port(port_base_addr);
@ -399,7 +399,7 @@ static int gpio_dw_port_clear_bits_raw(struct device *port, uint32_t mask)
static int gpio_dw_port_toggle_bits(struct device *port, uint32_t mask)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t port_base_addr = context->base_addr;
uint32_t data_port = dw_get_data_port(port_base_addr);
@ -416,7 +416,7 @@ static inline int gpio_dw_manage_callback(struct device *port,
struct gpio_callback *callback,
bool set)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
return gpio_manage_callback(&context->callbacks, callback, set);
}
@ -424,14 +424,14 @@ static inline int gpio_dw_manage_callback(struct device *port,
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
static void gpio_dw_set_power_state(struct device *port, uint32_t power_state)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
context->device_power_state = power_state;
}
static uint32_t gpio_dw_get_power_state(struct device *port)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
return context->device_power_state;
}
@ -485,7 +485,7 @@ static int gpio_dw_device_ctrl(struct device *port, uint32_t ctrl_command,
static void gpio_dw_isr(void *arg)
{
struct device *port = (struct device *)arg;
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
uint32_t base_addr = dw_base_to_block_base(context->base_addr);
uint32_t int_status;
@ -519,7 +519,7 @@ static const struct gpio_driver_api api_funcs = {
static int gpio_dw_initialize(struct device *port)
{
struct gpio_dw_runtime *context = port->driver_data;
struct gpio_dw_runtime *context = port->data;
const struct gpio_dw_config *config = port->config;
uint32_t base_addr;

View file

@ -60,7 +60,7 @@ static int gpio_esp32_config(struct device *dev,
gpio_pin_t pin,
gpio_flags_t flags)
{
struct gpio_esp32_data *data = dev->driver_data;
struct gpio_esp32_data *data = dev->data;
uint32_t io_pin = pin + data->port.pin_offset; /* Range from 0 - 39 */
uint32_t *reg = GET_GPIO_PIN_REG(io_pin);
uint32_t func;
@ -117,7 +117,7 @@ static int gpio_esp32_config(struct device *dev,
static int gpio_esp32_port_get_raw(struct device *port, uint32_t *value)
{
struct gpio_esp32_data *data = port->driver_data;
struct gpio_esp32_data *data = port->data;
*value = *data->port.input_reg;
@ -127,7 +127,7 @@ static int gpio_esp32_port_get_raw(struct device *port, uint32_t *value)
static int gpio_esp32_port_set_masked_raw(struct device *port,
uint32_t mask, uint32_t value)
{
struct gpio_esp32_data *data = port->driver_data;
struct gpio_esp32_data *data = port->data;
uint32_t key;
key = irq_lock();
@ -141,7 +141,7 @@ static int gpio_esp32_port_set_masked_raw(struct device *port,
static int gpio_esp32_port_set_bits_raw(struct device *port,
uint32_t pins)
{
struct gpio_esp32_data *data = port->driver_data;
struct gpio_esp32_data *data = port->data;
*data->port.set_reg = pins;
return 0;
@ -150,7 +150,7 @@ static int gpio_esp32_port_set_bits_raw(struct device *port,
static int gpio_esp32_port_clear_bits_raw(struct device *port,
uint32_t pins)
{
struct gpio_esp32_data *data = port->driver_data;
struct gpio_esp32_data *data = port->data;
*data->port.clear_reg = pins;
return 0;
@ -159,7 +159,7 @@ static int gpio_esp32_port_clear_bits_raw(struct device *port,
static int gpio_esp32_port_toggle_bits(struct device *port,
uint32_t pins)
{
struct gpio_esp32_data *data = port->driver_data;
struct gpio_esp32_data *data = port->data;
uint32_t key;
key = irq_lock();
@ -218,7 +218,7 @@ static int gpio_esp32_pin_interrupt_configure(struct device *port,
enum gpio_int_mode mode,
enum gpio_int_trig trig)
{
struct gpio_esp32_data *data = port->driver_data;
struct gpio_esp32_data *data = port->data;
uint32_t io_pin = pin + data->port.pin_offset; /* Range from 0 - 39 */
uint32_t *reg = GET_GPIO_PIN_REG(io_pin);
int intr_trig_mode = convert_int_type(mode, trig);
@ -248,14 +248,14 @@ static int gpio_esp32_manage_callback(struct device *dev,
struct gpio_callback *callback,
bool set)
{
struct gpio_esp32_data *data = dev->driver_data;
struct gpio_esp32_data *data = dev->data;
return gpio_manage_callback(&data->cb, callback, set);
}
static void gpio_esp32_fire_callbacks(struct device *device)
{
struct gpio_esp32_data *data = device->driver_data;
struct gpio_esp32_data *data = device->data;
uint32_t irq_status = *data->port.irq_status_reg;
*data->port.irq_ack_reg = irq_status;
@ -267,7 +267,7 @@ static void gpio_esp32_isr(void *param);
static int gpio_esp32_init(struct device *device)
{
struct gpio_esp32_data *data = device->driver_data;
struct gpio_esp32_data *data = device->data;
static bool isr_connected;
data->pinmux = device_get_binding(CONFIG_PINMUX_NAME);

View file

@ -180,7 +180,7 @@ static int gpio_gecko_pin_interrupt_configure(struct device *dev,
enum gpio_int_trig trig)
{
const struct gpio_gecko_config *config = dev->config;
struct gpio_gecko_data *data = dev->driver_data;
struct gpio_gecko_data *data = dev->data;
/* Interrupt on static level is not supported by the hardware */
if (mode == GPIO_INT_MODE_LEVEL) {
@ -221,7 +221,7 @@ static int gpio_gecko_pin_interrupt_configure(struct device *dev,
static int gpio_gecko_manage_callback(struct device *dev,
struct gpio_callback *callback, bool set)
{
struct gpio_gecko_data *data = dev->driver_data;
struct gpio_gecko_data *data = dev->data;
return gpio_manage_callback(&data->callbacks, callback, set);
}
@ -232,7 +232,7 @@ static int gpio_gecko_manage_callback(struct device *dev,
static void gpio_gecko_common_isr(void *arg)
{
struct device *dev = (struct device *)arg;
struct gpio_gecko_common_data *data = dev->driver_data;
struct gpio_gecko_common_data *data = dev->data;
uint32_t enabled_int, int_status;
struct device *port_dev;
struct gpio_gecko_data *port_data;
@ -241,7 +241,7 @@ static void gpio_gecko_common_isr(void *arg)
for (unsigned int i = 0; int_status && (i < data->count); i++) {
port_dev = data->ports[i];
port_data = port_dev->driver_data;
port_data = port_dev->data;
enabled_int = int_status & port_data->int_enabled_mask;
if (enabled_int != 0) {
int_status &= ~enabled_int;

View file

@ -124,7 +124,7 @@ static int gpio_ht16k33_pin_interrupt_configure(struct device *port,
void ht16k33_process_keyscan_row_data(struct device *dev,
uint32_t keys)
{
struct gpio_ht16k33_data *data = dev->driver_data;
struct gpio_ht16k33_data *data = dev->data;
gpio_fire_callbacks(&data->callbacks, dev, keys);
}
@ -133,14 +133,14 @@ static int gpio_ht16k33_manage_callback(struct device *dev,
struct gpio_callback *callback,
bool set)
{
struct gpio_ht16k33_data *data = dev->driver_data;
struct gpio_ht16k33_data *data = dev->data;
return gpio_manage_callback(&data->callbacks, callback, set);
}
static uint32_t gpio_ht16k33_get_pending_int(struct device *dev)
{
struct gpio_ht16k33_data *data = dev->driver_data;
struct gpio_ht16k33_data *data = dev->data;
return ht16k33_get_pending_int(data->parent);
}
@ -148,7 +148,7 @@ static uint32_t gpio_ht16k33_get_pending_int(struct device *dev)
static int gpio_ht16k33_init(struct device *dev)
{
const struct gpio_ht16k33_cfg *config = dev->config;
struct gpio_ht16k33_data *data = dev->driver_data;
struct gpio_ht16k33_data *data = dev->data;
if (config->keyscan_idx >= HT16K33_KEYSCAN_ROWS) {
LOG_ERR("HT16K33 keyscan index out of bounds (%d)",

View file

@ -177,7 +177,7 @@ static int imx_gpio_pin_interrupt_configure(struct device *port,
static int imx_gpio_manage_callback(struct device *port,
struct gpio_callback *cb, bool set)
{
struct imx_gpio_data *data = port->driver_data;
struct imx_gpio_data *data = port->data;
return gpio_manage_callback(&data->callbacks, cb, set);
}
@ -186,7 +186,7 @@ static void imx_gpio_port_isr(void *arg)
{
struct device *port = (struct device *)arg;
const struct imx_gpio_config *config = port->config;
struct imx_gpio_data *data = port->driver_data;
struct imx_gpio_data *data = port->data;
uint32_t int_status;
int_status = config->base->ISR;

View file

@ -106,7 +106,7 @@ BUILD_ASSERT(DT_INST_IRQN(0) == 14);
/* Required by DEVICE_MMIO_NAMED_* macros */
#define DEV_CFG(_dev) \
((const struct gpio_intel_apl_config *)(_dev)->config)
#define DEV_DATA(_dev) ((struct gpio_intel_apl_data *)(_dev)->driver_data)
#define DEV_DATA(_dev) ((struct gpio_intel_apl_data *)(_dev)->data)
struct gpio_intel_apl_config {
/* gpio_driver_config needs to be first */
@ -144,7 +144,7 @@ static inline mm_reg_t regs(struct device *dev)
*/
static bool check_perm(struct device *dev, uint32_t raw_pin)
{
struct gpio_intel_apl_data *data = dev->driver_data;
struct gpio_intel_apl_data *data = dev->data;
uint32_t offset, val;
/* First is to establish that host software owns the pin */
@ -196,7 +196,7 @@ static void gpio_intel_apl_isr(void *arg)
for (isr_dev = 0; isr_dev < nr_isr_devs; ++isr_dev) {
dev = isr_devs[isr_dev];
cfg = dev->config;
data = dev->driver_data;
data = dev->data;
reg = regs(dev) + REG_GPI_INT_STS_BASE
+ ((cfg->pin_offset >> 5) << 2);
@ -221,7 +221,7 @@ static int gpio_intel_apl_config(struct device *dev,
gpio_pin_t pin, gpio_flags_t flags)
{
const struct gpio_intel_apl_config *cfg = dev->config;
struct gpio_intel_apl_data *data = dev->driver_data;
struct gpio_intel_apl_data *data = dev->data;
uint32_t raw_pin, reg, cfg0, cfg1;
/* Only support push-pull mode */
@ -296,7 +296,7 @@ static int gpio_intel_apl_pin_interrupt_configure(struct device *dev,
enum gpio_int_trig trig)
{
const struct gpio_intel_apl_config *cfg = dev->config;
struct gpio_intel_apl_data *data = dev->driver_data;
struct gpio_intel_apl_data *data = dev->data;
uint32_t raw_pin, cfg0, cfg1;
uint32_t reg, reg_en, reg_sts;
@ -386,7 +386,7 @@ static int gpio_intel_apl_manage_callback(struct device *dev,
struct gpio_callback *callback,
bool set)
{
struct gpio_intel_apl_data *data = dev->driver_data;
struct gpio_intel_apl_data *data = dev->data;
return gpio_manage_callback(&data->cb, callback, set);
}
@ -395,7 +395,7 @@ static int port_get_raw(struct device *dev, uint32_t mask, uint32_t *value,
bool read_tx)
{
const struct gpio_intel_apl_config *cfg = dev->config;
struct gpio_intel_apl_data *data = dev->driver_data;
struct gpio_intel_apl_data *data = dev->data;
uint32_t pin, raw_pin, reg_addr, reg_val, cmp;
if (read_tx) {
@ -434,7 +434,7 @@ static int port_get_raw(struct device *dev, uint32_t mask, uint32_t *value,
static int port_set_raw(struct device *dev, uint32_t mask, uint32_t value)
{
const struct gpio_intel_apl_config *cfg = dev->config;
struct gpio_intel_apl_data *data = dev->driver_data;
struct gpio_intel_apl_data *data = dev->data;
uint32_t pin, raw_pin, reg_addr, reg_val;
while (mask != 0) {
@ -522,7 +522,7 @@ static const struct gpio_driver_api gpio_intel_apl_api = {
int gpio_intel_apl_init(struct device *dev)
{
struct gpio_intel_apl_data *data = dev->driver_data;
struct gpio_intel_apl_data *data = dev->data;
DEVICE_MMIO_NAMED_MAP(dev, reg_base, K_MEM_CACHE_NONE);
data->pad_base = sys_read32(regs(dev) + REG_PAD_BASE_ADDR);

View file

@ -37,7 +37,7 @@ struct gpio_lmp90xxx_data {
static int gpio_lmp90xxx_config(struct device *dev,
gpio_pin_t pin, gpio_flags_t flags)
{
struct gpio_lmp90xxx_data *data = dev->driver_data;
struct gpio_lmp90xxx_data *data = dev->data;
int err = 0;
if (pin > LMP90XXX_GPIO_MAX) {
@ -85,7 +85,7 @@ static int gpio_lmp90xxx_config(struct device *dev,
static int gpio_lmp90xxx_port_get_raw(struct device *dev,
gpio_port_value_t *value)
{
struct gpio_lmp90xxx_data *data = dev->driver_data;
struct gpio_lmp90xxx_data *data = dev->data;
return lmp90xxx_gpio_port_get_raw(data->parent, value);
}
@ -94,7 +94,7 @@ static int gpio_lmp90xxx_port_set_masked_raw(struct device *dev,
gpio_port_pins_t mask,
gpio_port_value_t value)
{
struct gpio_lmp90xxx_data *data = dev->driver_data;
struct gpio_lmp90xxx_data *data = dev->data;
return lmp90xxx_gpio_port_set_masked_raw(data->parent, mask, value);
}
@ -102,7 +102,7 @@ static int gpio_lmp90xxx_port_set_masked_raw(struct device *dev,
static int gpio_lmp90xxx_port_set_bits_raw(struct device *dev,
gpio_port_pins_t pins)
{
struct gpio_lmp90xxx_data *data = dev->driver_data;
struct gpio_lmp90xxx_data *data = dev->data;
return lmp90xxx_gpio_port_set_bits_raw(data->parent, pins);
}
@ -110,7 +110,7 @@ static int gpio_lmp90xxx_port_set_bits_raw(struct device *dev,
static int gpio_lmp90xxx_port_clear_bits_raw(struct device *dev,
gpio_port_pins_t pins)
{
struct gpio_lmp90xxx_data *data = dev->driver_data;
struct gpio_lmp90xxx_data *data = dev->data;
return lmp90xxx_gpio_port_clear_bits_raw(data->parent, pins);
}
@ -118,7 +118,7 @@ static int gpio_lmp90xxx_port_clear_bits_raw(struct device *dev,
static int gpio_lmp90xxx_port_toggle_bits(struct device *dev,
gpio_port_pins_t pins)
{
struct gpio_lmp90xxx_data *data = dev->driver_data;
struct gpio_lmp90xxx_data *data = dev->data;
return lmp90xxx_gpio_port_toggle_bits(data->parent, pins);
}
@ -139,7 +139,7 @@ static int gpio_lmp90xxx_pin_interrupt_configure(struct device *dev,
static int gpio_lmp90xxx_init(struct device *dev)
{
const struct gpio_lmp90xxx_config *config = dev->config;
struct gpio_lmp90xxx_data *data = dev->driver_data;
struct gpio_lmp90xxx_data *data = dev->data;
data->parent = device_get_binding(config->parent_dev_name);
if (!data->parent) {

View file

@ -26,7 +26,7 @@
#define DEV_CFG(dev) ((const struct gpio_lpc11u6x_config *) \
((dev)->config))
#define DEV_DATA(dev) ((struct gpio_lpc11u6x_data *) \
((dev)->driver_data))
((dev)->data))
/* Offset from syscon base address. */
#define LPC11U6X_PINTSEL_REGS 0x178
@ -469,21 +469,21 @@ static void gpio_lpc11u6x_isr(void *arg)
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio0), okay)
if (pins[0]) {
port = DEVICE_GET(gpio_lpc11u6x_0);
data = port->driver_data;
data = port->data;
gpio_fire_callbacks(&data->cb_list, port, pins[0]);
}
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio1), okay)
if (pins[1]) {
port = DEVICE_GET(gpio_lpc11u6x_1);
data = port->driver_data;
data = port->data;
gpio_fire_callbacks(&data->cb_list, port, pins[1]);
}
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio2), okay)
if (pins[2]) {
port = DEVICE_GET(gpio_lpc11u6x_2);
data = port->driver_data;
data = port->data;
gpio_fire_callbacks(&data->cb_list, port, pins[2]);
}
#endif

View file

@ -267,7 +267,7 @@ static int gpio_xec_port_get_raw(struct device *dev, uint32_t *value)
static int gpio_xec_manage_callback(struct device *dev,
struct gpio_callback *callback, bool set)
{
struct gpio_xec_data *data = dev->driver_data;
struct gpio_xec_data *data = dev->data;
gpio_manage_callback(&data->callbacks, callback, set);
@ -278,7 +278,7 @@ static void gpio_gpio_xec_port_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct gpio_xec_config *config = dev->config;
struct gpio_xec_data *data = dev->driver_data;
struct gpio_xec_data *data = dev->data;
uint32_t girq_result;
/* Figure out which interrupts have been triggered from the EC

Some files were not shown because too many files have changed in this diff Show more