drivers: constify all device instances

Run cocci script to constify device instances.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2022-01-06 14:10:19 +01:00 committed by Carles Cufí
parent d75f00a513
commit 16062c2e5a
11 changed files with 14 additions and 14 deletions

View file

@ -373,7 +373,7 @@ static void adc_context_update_buffer_pointer(struct adc_context *ctx,
static void adc_it8xxx2_isr(const void *arg)
{
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
struct adc_it8xxx2_data *data = dev->data;
LOG_DBG("ADC ISR triggered.");

View file

@ -76,7 +76,7 @@ struct mcux_adc16_data {
static void adc_dma_callback(const struct device *dma_dev, void *callback_arg,
uint32_t channel, int error_code)
{
struct device *dev = (struct device *)callback_arg;
const struct device *dev = (const struct device *)callback_arg;
struct mcux_adc16_data *data = dev->data;
LOG_DBG("DMA done");

View file

@ -242,7 +242,7 @@ static const struct counter_driver_api counter_api = {
static void counter_esp32_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
struct counter_esp32_data *data = dev->data;
counter_esp32_cancel_alarm(dev, 0);
uint32_t now;

View file

@ -1822,7 +1822,7 @@ static void phy_link_state_changed(const struct device *pdev,
struct phy_link_state *state,
void *user_data)
{
const struct device *dev = (struct device *) user_data;
const struct device *dev = (const struct device *) user_data;
struct eth_sam_dev_data *const dev_data = dev->data;
const struct eth_sam_dev_cfg *const cfg = dev->config;
bool is_up;

View file

@ -593,7 +593,7 @@ static int IRAM_ATTR i2c_esp32_transfer(const struct device *dev, struct i2c_msg
static void IRAM_ATTR i2c_esp32_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
struct i2c_esp32_data *data = (struct i2c_esp32_data *const)(dev)->data;
i2c_intr_event_t evt_type = I2C_INTR_EVENT_ERR;

View file

@ -883,7 +883,7 @@ static int i2c_it8xxx2_transfer(const struct device *dev, struct i2c_msg *msgs,
static void i2c_it8xxx2_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
struct i2c_it8xxx2_data *data = dev->data;
const struct i2c_it8xxx2_config *config = dev->config;

View file

@ -726,7 +726,7 @@ static int i2c_xec_transfer(const struct device *dev, struct i2c_msg *msgs,
static void i2c_xec_bus_isr(void *arg)
{
#ifdef CONFIG_I2C_SLAVE
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
const struct i2c_xec_config *config =
(const struct i2c_xec_config *const) (dev->config);
struct i2c_xec_data *data = dev->data;

View file

@ -801,7 +801,7 @@ static int i2c_xec_transfer(const struct device *dev, struct i2c_msg *msgs,
static void i2c_xec_bus_isr(void *arg)
{
#ifdef CONFIG_I2C_SLAVE
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
const struct i2c_xec_config *cfg =
(const struct i2c_xec_config *const) (dev->config);
struct i2c_xec_data *data = dev->data;

View file

@ -414,7 +414,7 @@ static void i2s_mcux_config_dma_blocks(const struct device *dev,
static void i2s_mcux_dma_tx_callback(const struct device *dma_dev, void *arg,
uint32_t channel, int status)
{
const struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
struct i2s_mcux_data *dev_data = dev->data;
struct stream *stream = &dev_data->tx;
void *buffer;
@ -474,7 +474,7 @@ static void i2s_mcux_dma_tx_callback(const struct device *dma_dev, void *arg,
static void i2s_mcux_dma_rx_callback(const struct device *dma_dev, void *arg,
uint32_t channel, int status)
{
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
struct i2s_mcux_data *dev_data = dev->data;
struct stream *stream = &dev_data->rx;
void *buffer;

View file

@ -186,7 +186,7 @@ static void i2s_rx_stream_disable(const struct device *dev)
static void i2s_dma_tx_callback(const struct device *dma_dev,
void *arg, uint32_t channel, int status)
{
const struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
const struct i2s_mcux_config *dev_cfg = dev->config;
I2S_Type *base = (I2S_Type *)dev_cfg->base;
struct i2s_dev_data *dev_data = dev->data;
@ -257,7 +257,7 @@ static void i2s_dma_tx_callback(const struct device *dma_dev,
static void i2s_dma_rx_callback(const struct device *dma_dev,
void *arg, uint32_t channel, int status)
{
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
const struct i2s_mcux_config *dev_cfg = dev->config;
I2S_Type *base = (I2S_Type *)dev_cfg->base;
struct i2s_dev_data *dev_data = dev->data;
@ -928,7 +928,7 @@ static void sai_driver_irq(const struct device *dev)
/* clear IRQ sources atm */
static void i2s_mcux_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct device *dev = (const struct device *)arg;
const struct i2s_mcux_config *dev_cfg = dev->config;
I2S_Type *base = (I2S_Type *)dev_cfg->base;

View file

@ -472,7 +472,7 @@ static int configure_dma(const struct device *dev)
static void dma_callback(const struct device *dma_dev, void *callback_arg,
uint32_t channel, int error_code)
{
const struct device *dev = (struct device *)callback_arg;
const struct device *dev = (const struct device *)callback_arg;
const struct spi_mcux_config *config = dev->config;
SPI_Type *base = config->base;
struct spi_mcux_data *data = dev->data;