diff options
author | Tom Rini | 2018-01-24 11:28:44 -0500 |
---|---|---|
committer | Tom Rini | 2018-01-24 11:28:44 -0500 |
commit | fb4413295c765aa8c013650984dc2d908964c81d (patch) | |
tree | 310dec76e0dd7c9227bad54ed372657f8e59713d /include/dm/read.h | |
parent | 16121280188d3daa57b18ad623d0845bbbb5a90a (diff) | |
parent | 2f516e4aa286eb0203e34ab9be68b08f7a3c44c1 (diff) |
Merge git://git.denx.de/u-boot-mmc
Diffstat (limited to 'include/dm/read.h')
-rw-r--r-- | include/dm/read.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/read.h b/include/dm/read.h index 2551e5f0dcf..f1f0dfd4a33 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -46,6 +46,16 @@ static inline bool dev_of_valid(struct udevice *dev) #ifndef CONFIG_DM_DEV_READ_INLINE /** + * dev_read_u32() - read a 32-bit integer from a device's DT property + * + * @dev: device to read DT property from + * @propname: name of the property to read from + * @outp: place to put value (if found) + * @return 0 if OK, -ve on error + */ +int dev_read_u32(struct udevice *dev, const char *propname, u32 *outp); + +/** * dev_read_u32_default() - read a 32-bit integer from a device's DT property * * @dev: device to read DT property from @@ -424,6 +434,12 @@ int dev_read_resource_byname(struct udevice *dev, const char *name, u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr); #else /* CONFIG_DM_DEV_READ_INLINE is enabled */ +static inline int dev_read_u32(struct udevice *dev, + const char *propname, u32 *outp) +{ + return ofnode_read_u32(dev_ofnode(dev), propname, outp); +} + static inline int dev_read_u32_default(struct udevice *dev, const char *propname, int def) { |