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>
This commit is contained in:
Simon Glass
2020-07-20 11:37:47 -06:00
parent 3b9a87321c
commit f07e58b878
15 changed files with 63 additions and 58 deletions
+4 -4
View File
@@ -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);