core: read: add dev_read_s32_default()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: I174670da004001feafcec568e978d2dfd9f55ef9
This commit is contained in:
parent
2442fbadc2
commit
270d4d86b3
|
|
@ -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);
|
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)
|
const char *dev_read_string(struct udevice *dev, const char *propname)
|
||||||
{
|
{
|
||||||
return ofnode_read_string(dev_ofnode(dev), propname);
|
return ofnode_read_string(dev_ofnode(dev), propname);
|
||||||
|
|
|
||||||
|
|
@ -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);
|
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
|
* dev_read_string() - Read a string from a device's DT property
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue