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:
Samuel Holland
2024-07-30 21:58:51 -07:00
committed by Anup Patel
parent 57a0479302
commit bd76eb4950
11 changed files with 14 additions and 14 deletions

View File

@@ -16,7 +16,7 @@
struct fdt_serial {
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);

View File

@@ -23,7 +23,7 @@ int fdt_serial_init(void)
struct fdt_serial *drv;
const struct fdt_match *match;
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 */
coff = fdt_path_offset(fdt, "/chosen");

View File

@@ -10,7 +10,7 @@
#include <sbi_utils/serial/fdt_serial.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)
{
int rc;

View File

@@ -11,7 +11,7 @@
#include <sbi_utils/serial/fdt_serial.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)
{
int rc;

View File

@@ -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)
{
int rc;

View File

@@ -12,7 +12,7 @@
#include <sbi_utils/serial/fdt_serial.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)
{
uint64_t reg_addr, reg_size;

View File

@@ -7,7 +7,7 @@
#include <sbi_utils/serial/fdt_serial.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)
{
struct platform_uart_data uart = { 0 };

View File

@@ -9,8 +9,8 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/shakti-uart.h>
static int serial_shakti_init(void *fdt, int nodeoff,
const struct fdt_match *match)
static int serial_shakti_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
struct platform_uart_data uart = { 0 };

View File

@@ -11,8 +11,8 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/sifive-uart.h>
static int serial_sifive_init(void *fdt, int nodeoff,
const struct fdt_match *match)
static int serial_sifive_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
struct platform_uart_data uart = { 0 };

View File

@@ -11,7 +11,7 @@
#include <sbi_utils/serial/fdt_serial.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)
{
int rc;

View File

@@ -11,8 +11,8 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/xlnx_uartlite.h>
static int serial_xlnx_uartlite_init(void *fdt, int nodeoff,
const struct fdt_match *match)
static int serial_xlnx_uartlite_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
struct platform_uart_data uart = { 0 };