device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all the other attributes, it is possible to switch all device driver instance to be constant. A coccinelle rule is used for this: @r_const_dev_1 disable optional_qualifier @ @@ -struct device * +const struct device * @r_const_dev_2 disable optional_qualifier @ @@ -struct device * const +const struct device * Fixes #27399 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
c8906fef79
commit
e18fcbba5a
1426 changed files with 9356 additions and 8368 deletions
|
@ -33,7 +33,7 @@ struct dma_sam0_data {
|
|||
/* Handles DMA interrupts and dispatches to the individual channel */
|
||||
static void dma_sam0_isr(void *arg)
|
||||
{
|
||||
struct device *dev = arg;
|
||||
const struct device *dev = arg;
|
||||
struct dma_sam0_data *data = DEV_DATA(dev);
|
||||
struct dma_sam0_channel *chdata;
|
||||
uint16_t pend = DMA_REGS->INTPEND.reg;
|
||||
|
@ -63,7 +63,7 @@ static void dma_sam0_isr(void *arg)
|
|||
}
|
||||
|
||||
/* Configure a channel */
|
||||
static int dma_sam0_config(struct device *dev, uint32_t channel,
|
||||
static int dma_sam0_config(const struct device *dev, uint32_t channel,
|
||||
struct dma_config *config)
|
||||
{
|
||||
struct dma_sam0_data *data = DEV_DATA(dev);
|
||||
|
@ -265,7 +265,7 @@ inval:
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int dma_sam0_start(struct device *dev, uint32_t channel)
|
||||
static int dma_sam0_start(const struct device *dev, uint32_t channel)
|
||||
{
|
||||
int key = irq_lock();
|
||||
|
||||
|
@ -296,7 +296,7 @@ static int dma_sam0_start(struct device *dev, uint32_t channel)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dma_sam0_stop(struct device *dev, uint32_t channel)
|
||||
static int dma_sam0_stop(const struct device *dev, uint32_t channel)
|
||||
{
|
||||
int key = irq_lock();
|
||||
|
||||
|
@ -316,7 +316,7 @@ static int dma_sam0_stop(struct device *dev, uint32_t channel)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dma_sam0_reload(struct device *dev, uint32_t channel,
|
||||
static int dma_sam0_reload(const struct device *dev, uint32_t channel,
|
||||
uint32_t src, uint32_t dst, size_t size)
|
||||
{
|
||||
struct dma_sam0_data *data = DEV_DATA(dev);
|
||||
|
@ -360,7 +360,7 @@ inval:
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int dma_sam0_get_status(struct device *dev, uint32_t channel,
|
||||
static int dma_sam0_get_status(const struct device *dev, uint32_t channel,
|
||||
struct dma_status *stat)
|
||||
{
|
||||
struct dma_sam0_data *data = DEV_DATA(dev);
|
||||
|
@ -407,7 +407,7 @@ DEVICE_DECLARE(dma_sam0_0);
|
|||
irq_enable(DT_INST_IRQ_BY_IDX(0, n, irq)); \
|
||||
} while (0)
|
||||
|
||||
static int dma_sam0_init(struct device *dev)
|
||||
static int dma_sam0_init(const struct device *dev)
|
||||
{
|
||||
struct dma_sam0_data *data = DEV_DATA(dev);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue