tests: 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:
parent
16062c2e5a
commit
c94b341a54
|
@ -79,7 +79,7 @@ static void dma_user_callback(const struct device *dma_dev, void *arg,
|
|||
* the device is the DMAMUX, given through
|
||||
* the stream->user_data by the dma_stm32_irq_handler
|
||||
*/
|
||||
test_transfer((struct device *)arg, id);
|
||||
test_transfer((const struct device *)arg, id);
|
||||
#else
|
||||
test_transfer(dma_dev, id);
|
||||
#endif /* CONFIG_DMAMUX_STM32 */
|
||||
|
@ -113,7 +113,7 @@ static int test_loop(void)
|
|||
dma_cfg.source_burst_length = 1U;
|
||||
dma_cfg.dest_burst_length = 1U;
|
||||
#ifdef CONFIG_DMAMUX_STM32
|
||||
dma_cfg.user_data = (struct device *)dma;
|
||||
dma_cfg.user_data = (void *)dma;
|
||||
#else
|
||||
dma_cfg.user_data = NULL;
|
||||
#endif /* CONFIG_DMAMUX_STM32 */
|
||||
|
|
|
@ -36,7 +36,8 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
|
|||
/* Enable wakeup source. Next time the system is called
|
||||
* to sleep, this device will still be active.
|
||||
*/
|
||||
(void)pm_device_wakeup_enable((struct device *)dev, true);
|
||||
(void)pm_device_wakeup_enable((const struct device *)dev,
|
||||
true);
|
||||
break;
|
||||
case 2:
|
||||
zassert_equal(state, PM_STATE_SUSPEND_TO_RAM, "Wrong system state");
|
||||
|
@ -86,13 +87,13 @@ void test_wakeup_device_api(void)
|
|||
ret = pm_device_wakeup_is_capable(dev);
|
||||
zassert_true(ret, "Device marked as capable");
|
||||
|
||||
ret = pm_device_wakeup_enable((struct device *)dev, true);
|
||||
ret = pm_device_wakeup_enable((const struct device *)dev, true);
|
||||
zassert_true(ret, "Could not enable wakeup source");
|
||||
|
||||
ret = pm_device_wakeup_is_enabled(dev);
|
||||
zassert_true(ret, "Wakeup source not enabled");
|
||||
|
||||
ret = pm_device_wakeup_enable((struct device *)dev, false);
|
||||
ret = pm_device_wakeup_enable((const struct device *)dev, false);
|
||||
zassert_true(ret, "Could not disable wakeup source");
|
||||
|
||||
ret = pm_device_wakeup_is_enabled(dev);
|
||||
|
|
|
@ -417,7 +417,7 @@ void test_busy(void)
|
|||
|
||||
void test_device_state_lock(void)
|
||||
{
|
||||
pm_device_state_lock((struct device *)device_a);
|
||||
pm_device_state_lock((const struct device *)device_a);
|
||||
zassert_true(pm_device_state_is_locked(device_a), NULL);
|
||||
|
||||
testing_device_lock = true;
|
||||
|
@ -425,7 +425,7 @@ void test_device_state_lock(void)
|
|||
|
||||
k_sleep(SLEEP_TIMEOUT);
|
||||
|
||||
pm_device_state_unlock((struct device *)device_a);
|
||||
pm_device_state_unlock((const struct device *)device_a);
|
||||
|
||||
testing_device_lock = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue