summaryrefslogtreecommitdiff
path: root/arch/nios2
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 /arch/nios2
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 'arch/nios2')
-rw-r--r--arch/nios2/cpu/cpu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 7f5e731a0f..e7ca9882fc 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -79,7 +79,8 @@ int arch_cpu_init_dm(void)
return 0;
}
-static int altera_nios2_get_desc(struct udevice *dev, char *buf, int size)
+static int altera_nios2_get_desc(const struct udevice *dev, char *buf,
+ int size)
{
const char *cpu_name = "Nios-II";
@@ -90,7 +91,8 @@ static int altera_nios2_get_desc(struct udevice *dev, char *buf, int size)
return 0;
}
-static int altera_nios2_get_info(struct udevice *dev, struct cpu_info *info)
+static int altera_nios2_get_info(const struct udevice *dev,
+ struct cpu_info *info)
{
info->cpu_freq = gd->cpu_clk;
info->features = (1 << CPU_FEAT_L1_CACHE) |
@@ -99,7 +101,7 @@ static int altera_nios2_get_info(struct udevice *dev, struct cpu_info *info)
return 0;
}
-static int altera_nios2_get_count(struct udevice *dev)
+static int altera_nios2_get_count(const struct udevice *dev)
{
return 1;
}