Update this function to take an ofnode so that it can work with livetree.
Signed-off-by: Simon Glass <sjg@chromium.org>
#include <dm/of_extra.h>
#include <dm/ofnode.h>
-int of_read_fmap_entry(ofnode node, const char *name,
- struct fmap_entry *entry)
+int ofnode_read_fmap_entry(ofnode node, struct fmap_entry *entry)
{
const char *prop;
u32 reg[2];
if (ofnode_read_u32_array(node, "reg", reg, 2)) {
- debug("Node '%s' has bad/missing 'reg' property\n", name);
- return -FDT_ERR_NOTFOUND;
+ debug("Node '%s' has bad/missing 'reg' property\n",
+ ofnode_get_name(node));
+ return -log_ret(ENOENT);
}
entry->offset = reg[0];
entry->length = reg[1];
return -1;
}
- if (of_read_fmap_entry(flash_node, "flash", &config->flash)) {
+ if (ofnode_read_fmap_entry(flash_node, &config->flash)) {
debug("Failed to decode flash node in chrome-ec\n");
return -1;
}
return -1;
}
- if (of_read_fmap_entry(node, "reg", &config->region[region])) {
+ if (ofnode_read_fmap_entry(node, &config->region[region])) {
debug("Failed to decode flash region in chrome-ec'\n");
return -1;
}
/**
* Read a flash entry from the fdt
*
- * @param node Reference to node to read
- * @param name Name of node being read
+ * @param node Reference to node to read
* @param entry Place to put offset and size of this node
* @return 0 if ok, -ve on error
*/
-int of_read_fmap_entry(ofnode node, const char *name,
- struct fmap_entry *entry);
+int ofnode_read_fmap_entry(ofnode node, struct fmap_entry *entry);
#endif