summaryrefslogtreecommitdiff
path: root/drivers/cpu/riscv_cpu.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-01-27 08:06:27 +0300
committerSimon Glass <sjg@chromium.org>2020-07-20 20:37:47 +0300
commitf07e58b878fc18bd69d2c19075f0fb8d7d35da00 (patch)
treeca468b413f8eee4677bc83c4adf1c118956eacb2 /drivers/cpu/riscv_cpu.c
parent3b9a87321cf5f40ad4c8dac535f94b0cbde19ce2 (diff)
downloadu-boot-f07e58b878fc18bd69d2c19075f0fb8d7d35da00.tar.xz
cpu: Convert the methods to use a const udevice *
These functions should not modify the device. Convert them to const so that callers don't need to cast if they have a const udevice *. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/cpu/riscv_cpu.c')
-rw-r--r--drivers/cpu/riscv_cpu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cpu/riscv_cpu.c b/drivers/cpu/riscv_cpu.c
index 100fe5542e..93ce708f65 100644
--- a/drivers/cpu/riscv_cpu.c
+++ b/drivers/cpu/riscv_cpu.c
@@ -17,7 +17,7 @@
DECLARE_GLOBAL_DATA_PTR;
-static int riscv_cpu_get_desc(struct udevice *dev, char *buf, int size)
+static int riscv_cpu_get_desc(const struct udevice *dev, char *buf, int size)
{
const char *isa;
@@ -30,7 +30,7 @@ static int riscv_cpu_get_desc(struct udevice *dev, char *buf, int size)
return 0;
}
-static int riscv_cpu_get_info(struct udevice *dev, struct cpu_info *info)
+static int riscv_cpu_get_info(const struct udevice *dev, struct cpu_info *info)
{
int ret;
struct clk clk;
@@ -39,7 +39,7 @@ static int riscv_cpu_get_info(struct udevice *dev, struct cpu_info *info)
u32 d_cache_size;
/* First try getting the frequency from the assigned clock */
- ret = clk_get_by_index(dev, 0, &clk);
+ ret = clk_get_by_index((struct udevice *)dev, 0, &clk);
if (!ret) {
ret = clk_get_rate(&clk);
if (!IS_ERR_VALUE(ret))
@@ -67,7 +67,7 @@ static int riscv_cpu_get_info(struct udevice *dev, struct cpu_info *info)
return 0;
}
-static int riscv_cpu_get_count(struct udevice *dev)
+static int riscv_cpu_get_count(const struct udevice *dev)
{
ofnode node;
int num = 0;