1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

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-01-26 22:06:27 -07:00
parent fdc34368dd
commit 961420fa5f
15 changed files with 63 additions and 58 deletions

View File

@@ -100,7 +100,7 @@ static int cpu_imx_get_temp(struct cpu_imx_platdata *plat)
}
#endif
int cpu_imx_get_desc(struct udevice *dev, char *buf, int size)
int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size)
{
struct cpu_imx_platdata *plat = dev_get_platdata(dev);
int ret, temp;
@@ -126,7 +126,7 @@ int cpu_imx_get_desc(struct udevice *dev, char *buf, int size)
return 0;
}
static int cpu_imx_get_info(struct udevice *dev, struct cpu_info *info)
static int cpu_imx_get_info(const struct udevice *dev, struct cpu_info *info)
{
struct cpu_imx_platdata *plat = dev_get_platdata(dev);
@@ -135,7 +135,7 @@ static int cpu_imx_get_info(struct udevice *dev, struct cpu_info *info)
return 0;
}
static int cpu_imx_get_count(struct udevice *dev)
static int cpu_imx_get_count(const struct udevice *dev)
{
ofnode node;
int num = 0;
@@ -157,7 +157,7 @@ static int cpu_imx_get_count(struct udevice *dev)
return num;
}
static int cpu_imx_get_vendor(struct udevice *dev, char *buf, int size)
static int cpu_imx_get_vendor(const struct udevice *dev, char *buf, int size)
{
snprintf(buf, size, "NXP");
return 0;