aboutsummaryrefslogtreecommitdiff
path: root/drivers/cpu/cpu-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-01-26 22:06:27 -0700
committerSimon Glass <sjg@chromium.org>2020-07-20 11:37:47 -0600
commitf07e58b878fc18bd69d2c19075f0fb8d7d35da00 (patch)
treeca468b413f8eee4677bc83c4adf1c118956eacb2 /drivers/cpu/cpu-uclass.c
parent3b9a87321cf5f40ad4c8dac535f94b0cbde19ce2 (diff)
downloadu-boot-f07e58b878fc18bd69d2c19075f0fb8d7d35da00.zip
u-boot-f07e58b878fc18bd69d2c19075f0fb8d7d35da00.tar.gz
u-boot-f07e58b878fc18bd69d2c19075f0fb8d7d35da00.tar.bz2
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-uclass.c')
-rw-r--r--drivers/cpu/cpu-uclass.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cpu/cpu-uclass.c b/drivers/cpu/cpu-uclass.c
index cbb4419..37e3cf2 100644
--- a/drivers/cpu/cpu-uclass.c
+++ b/drivers/cpu/cpu-uclass.c
@@ -69,7 +69,7 @@ struct udevice *cpu_get_current_dev(void)
return cpu;
}
-int cpu_get_desc(struct udevice *dev, char *buf, int size)
+int cpu_get_desc(const struct udevice *dev, char *buf, int size)
{
struct cpu_ops *ops = cpu_get_ops(dev);
@@ -79,7 +79,7 @@ int cpu_get_desc(struct udevice *dev, char *buf, int size)
return ops->get_desc(dev, buf, size);
}
-int cpu_get_info(struct udevice *dev, struct cpu_info *info)
+int cpu_get_info(const struct udevice *dev, struct cpu_info *info)
{
struct cpu_ops *ops = cpu_get_ops(dev);
@@ -92,7 +92,7 @@ int cpu_get_info(struct udevice *dev, struct cpu_info *info)
return ops->get_info(dev, info);
}
-int cpu_get_count(struct udevice *dev)
+int cpu_get_count(const struct udevice *dev)
{
struct cpu_ops *ops = cpu_get_ops(dev);
@@ -102,7 +102,7 @@ int cpu_get_count(struct udevice *dev)
return ops->get_count(dev);
}
-int cpu_get_vendor(struct udevice *dev, char *buf, int size)
+int cpu_get_vendor(const struct udevice *dev, char *buf, int size)
{
struct cpu_ops *ops = cpu_get_ops(dev);