zephyr/soc/arc/snps_emsk/soc_config.c
Tomasz Bursztyka e18fcbba5a 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>
2020-09-02 13:48:13 +02:00

36 lines
929 B
C

/*
* Copyright (c) 2018 Synopsys, Inc. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <device.h>
#include <init.h>
#include "soc.h"
#ifdef CONFIG_UART_NS16550
static int uart_ns16550_init(const struct device *dev)
{
ARG_UNUSED(dev);
/* On ARC EM Starter kit board,
* send the UART the command to clear the interrupt
*/
#if DT_NODE_HAS_STATUS(DT_INST(0, ns16550), okay)
sys_write32(0, DT_REG_ADDR(DT_INST(0, ns16550))+0x4);
sys_write32(0, DT_REG_ADDR(DT_INST(0, ns16550))+0x10);
#endif /* DT_NODE_HAS_STATUS(DT_INST(0, ns16550), okay) */
#if DT_NODE_HAS_STATUS(DT_INST(1, ns16550), okay)
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x4);
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x10);
#endif /* DT_NODE_HAS_STATUS(DT_INST(1, ns16550), okay) */
return 0;
}
SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_NS16550 */