diff options
author | Simon Glass <sjg@chromium.org> | 2020-01-26 22:06:27 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-20 11:37:47 -0600 |
commit | f07e58b878fc18bd69d2c19075f0fb8d7d35da00 (patch) | |
tree | ca468b413f8eee4677bc83c4adf1c118956eacb2 /drivers/cpu/cpu_sandbox.c | |
parent | 3b9a87321cf5f40ad4c8dac535f94b0cbde19ce2 (diff) | |
download | u-boot-f07e58b878fc18bd69d2c19075f0fb8d7d35da00.tar.gz |
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/cpu_sandbox.c')
-rw-r--r-- | drivers/cpu/cpu_sandbox.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cpu/cpu_sandbox.c b/drivers/cpu/cpu_sandbox.c index 30a12e5a535..caa26e50f28 100644 --- a/drivers/cpu/cpu_sandbox.c +++ b/drivers/cpu/cpu_sandbox.c @@ -8,14 +8,14 @@ #include <dm.h> #include <cpu.h> -int cpu_sandbox_get_desc(struct udevice *dev, char *buf, int size) +int cpu_sandbox_get_desc(const struct udevice *dev, char *buf, int size) { snprintf(buf, size, "LEG Inc. SuperMegaUltraTurbo CPU No. 1"); return 0; } -int cpu_sandbox_get_info(struct udevice *dev, struct cpu_info *info) +int cpu_sandbox_get_info(const struct udevice *dev, struct cpu_info *info) { info->cpu_freq = 42 * 42 * 42 * 42 * 42; info->features = 0x42424242; @@ -24,12 +24,12 @@ int cpu_sandbox_get_info(struct udevice *dev, struct cpu_info *info) return 0; } -int cpu_sandbox_get_count(struct udevice *dev) +int cpu_sandbox_get_count(const struct udevice *dev) { return 42; } -int cpu_sandbox_get_vendor(struct udevice *dev, char *buf, int size) +int cpu_sandbox_get_vendor(const struct udevice *dev, char *buf, int size) { snprintf(buf, size, "Languid Example Garbage Inc."); |