forked from Mirrors/opensbi
lib: utils/serial: Constify FDT pointers in parsing functions
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
57a0479302
commit
bd76eb4950
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
struct fdt_serial {
|
struct fdt_serial {
|
||||||
const struct fdt_match *match_table;
|
const struct fdt_match *match_table;
|
||||||
int (*init)(void *fdt, int nodeoff, const struct fdt_match *match);
|
int (*init)(const void *fdt, int nodeoff, const struct fdt_match *match);
|
||||||
};
|
};
|
||||||
|
|
||||||
int fdt_serial_init(void);
|
int fdt_serial_init(void);
|
||||||
|
@@ -23,7 +23,7 @@ int fdt_serial_init(void)
|
|||||||
struct fdt_serial *drv;
|
struct fdt_serial *drv;
|
||||||
const struct fdt_match *match;
|
const struct fdt_match *match;
|
||||||
int pos, noff = -1, len, coff, rc;
|
int pos, noff = -1, len, coff, rc;
|
||||||
void *fdt = fdt_get_address();
|
const void *fdt = fdt_get_address();
|
||||||
|
|
||||||
/* Find offset of node pointed to by stdout-path */
|
/* Find offset of node pointed to by stdout-path */
|
||||||
coff = fdt_path_offset(fdt, "/chosen");
|
coff = fdt_path_offset(fdt, "/chosen");
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/cadence-uart.h>
|
#include <sbi_utils/serial/cadence-uart.h>
|
||||||
|
|
||||||
static int serial_cadence_init(void *fdt, int nodeoff,
|
static int serial_cadence_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/gaisler-uart.h>
|
#include <sbi_utils/serial/gaisler-uart.h>
|
||||||
|
|
||||||
static int serial_gaisler_init(void *fdt, int nodeoff,
|
static int serial_gaisler_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
@@ -18,7 +18,7 @@ static const struct fdt_match serial_htif_match[] = {
|
|||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int serial_htif_init(void *fdt, int nodeoff,
|
static int serial_htif_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/litex-uart.h>
|
#include <sbi_utils/serial/litex-uart.h>
|
||||||
|
|
||||||
static int serial_litex_init(void *fdt, int nodeoff,
|
static int serial_litex_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
uint64_t reg_addr, reg_size;
|
uint64_t reg_addr, reg_size;
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/renesas-scif.h>
|
#include <sbi_utils/serial/renesas-scif.h>
|
||||||
|
|
||||||
static int serial_renesas_scif_init(void *fdt, int nodeoff,
|
static int serial_renesas_scif_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
struct platform_uart_data uart = { 0 };
|
struct platform_uart_data uart = { 0 };
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/shakti-uart.h>
|
#include <sbi_utils/serial/shakti-uart.h>
|
||||||
|
|
||||||
static int serial_shakti_init(void *fdt, int nodeoff,
|
static int serial_shakti_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
struct platform_uart_data uart = { 0 };
|
struct platform_uart_data uart = { 0 };
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/sifive-uart.h>
|
#include <sbi_utils/serial/sifive-uart.h>
|
||||||
|
|
||||||
static int serial_sifive_init(void *fdt, int nodeoff,
|
static int serial_sifive_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
struct platform_uart_data uart = { 0 };
|
struct platform_uart_data uart = { 0 };
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/uart8250.h>
|
#include <sbi_utils/serial/uart8250.h>
|
||||||
|
|
||||||
static int serial_uart8250_init(void *fdt, int nodeoff,
|
static int serial_uart8250_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
#include <sbi_utils/serial/fdt_serial.h>
|
#include <sbi_utils/serial/fdt_serial.h>
|
||||||
#include <sbi_utils/serial/xlnx_uartlite.h>
|
#include <sbi_utils/serial/xlnx_uartlite.h>
|
||||||
|
|
||||||
static int serial_xlnx_uartlite_init(void *fdt, int nodeoff,
|
static int serial_xlnx_uartlite_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
struct platform_uart_data uart = { 0 };
|
struct platform_uart_data uart = { 0 };
|
||||||
|
Reference in New Issue
Block a user