core: read: add dev_read_s32_default()

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I174670da004001feafcec568e978d2dfd9f55ef9
This commit is contained in:
Joseph Chen 2019-11-21 18:08:02 +08:00 committed by Jianhong Chen
parent 2442fbadc2
commit 270d4d86b3
2 changed files with 15 additions and 0 deletions

View File

@ -15,6 +15,11 @@ int dev_read_u32_default(struct udevice *dev, const char *propname, int def)
return ofnode_read_u32_default(dev_ofnode(dev), propname, def);
}
int dev_read_s32_default(struct udevice *dev, const char *propname, int def)
{
return ofnode_read_s32_default(dev_ofnode(dev), propname, def);
}
const char *dev_read_string(struct udevice *dev, const char *propname)
{
return ofnode_read_string(dev_ofnode(dev), propname);

View File

@ -55,6 +55,16 @@ static inline bool dev_of_valid(struct udevice *dev)
*/
int dev_read_u32_default(struct udevice *dev, const char *propname, int def);
/**
* dev_read_s32_default() - read a signed 32-bit integer from a device's DT property
*
* @dev: device to read DT property from
* @propname: name of the property to read from
* @def: default value to return if the property has no value
* @return property value, or @def if not found
*/
int dev_read_s32_default(struct udevice *dev, const char *propname, int def);
/**
* dev_read_string() - Read a string from a device's DT property
*