Merge patch series "dm: core: use {s,u}32 instead of int for dev_read_{s,u}32_default"

Quentin Schulz <foss+uboot@0leil.net> says:

Out of all the dev_read_*_default functions, only two do not properly
use the type as argument and return type: dev_read_u32_default and
dev_read_s32_default. They both use int instead of u32/s32.

Considering that it's generally not guaranteed that an int is 4 bytes
but also for consistency sake, let's have them use the expected type.

Note that I have not tested this, just stumbled upon that inconsistency
by chance.

Link: https://lore.kernel.org/r/20250528-dev_read_x32_default-v1-0-6ab1734dd7a2@cherry.de
This commit is contained in:
Tom Rini 2025-06-11 13:31:45 -06:00
commit ae297ca722
2 changed files with 11 additions and 11 deletions

View File

@ -38,8 +38,8 @@ int dev_read_u32(const struct udevice *dev, const char *propname, u32 *outp)
return ofnode_read_u32(dev_ofnode(dev), propname, outp);
}
int dev_read_u32_default(const struct udevice *dev, const char *propname,
int def)
u32 dev_read_u32_default(const struct udevice *dev, const char *propname,
u32 def)
{
return ofnode_read_u32_default(dev_ofnode(dev), propname, def);
}
@ -62,8 +62,8 @@ int dev_read_s32(const struct udevice *dev, const char *propname, s32 *outp)
return ofnode_read_u32(dev_ofnode(dev), propname, (u32 *)outp);
}
int dev_read_s32_default(const struct udevice *dev, const char *propname,
int def)
s32 dev_read_s32_default(const struct udevice *dev, const char *propname,
s32 def)
{
return ofnode_read_u32_default(dev_ofnode(dev), propname, def);
}

View File

@ -90,8 +90,8 @@ int dev_read_u32(const struct udevice *dev, const char *propname, u32 *outp);
* @def: default value to return if the property has no value
* Return: property value, or @def if not found
*/
int dev_read_u32_default(const struct udevice *dev, const char *propname,
int def);
u32 dev_read_u32_default(const struct udevice *dev, const char *propname,
u32 def);
/**
* dev_read_u32_index() - read an indexed 32-bit integer from a device's DT
@ -137,8 +137,8 @@ int dev_read_s32(const struct udevice *dev, const char *propname, s32 *outp);
* @def: default value to return if the property has no value
* Return: property value, or @def if not found
*/
int dev_read_s32_default(const struct udevice *dev, const char *propname,
int def);
s32 dev_read_s32_default(const struct udevice *dev, const char *propname,
s32 def);
/**
* dev_read_u32u() - read a 32-bit integer from a device's DT property
@ -896,7 +896,7 @@ static inline int dev_read_u32(const struct udevice *dev,
}
static inline int dev_read_u32_default(const struct udevice *dev,
const char *propname, int def)
const char *propname, u32 def)
{
return ofnode_read_u32_default(dev_ofnode(dev), propname, def);
}
@ -921,8 +921,8 @@ static inline int dev_read_s32(const struct udevice *dev,
return ofnode_read_s32(dev_ofnode(dev), propname, outp);
}
static inline int dev_read_s32_default(const struct udevice *dev,
const char *propname, int def)
static inline s32 dev_read_s32_default(const struct udevice *dev,
const char *propname, s32 def)
{
return ofnode_read_s32_default(dev_ofnode(dev), propname, def);
}