@@ -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);
@@ -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");
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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 };
@@ -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 };
@@ -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 };
@@ -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;
@@ -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 };
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> --- include/sbi_utils/serial/fdt_serial.h | 2 +- lib/utils/serial/fdt_serial.c | 2 +- lib/utils/serial/fdt_serial_cadence.c | 2 +- lib/utils/serial/fdt_serial_gaisler.c | 2 +- lib/utils/serial/fdt_serial_htif.c | 2 +- lib/utils/serial/fdt_serial_litex.c | 2 +- lib/utils/serial/fdt_serial_renesas_scif.c | 2 +- lib/utils/serial/fdt_serial_shakti.c | 4 ++-- lib/utils/serial/fdt_serial_sifive.c | 4 ++-- lib/utils/serial/fdt_serial_uart8250.c | 2 +- lib/utils/serial/fdt_serial_xlnx_uartlite.c | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-)