/* The layout of the ibm,dynamic-memory property is a number N of lmb list entries followed by N lmb list entries. Each lmb list entry contains information as layed out in the  */
static int of_get_drconf_memory(struct device_node *memory, const u32 **dm)
/* The layout of the ibm,dynamic-memory property is a number N of lmb list entries followed by N lmb list entries. Each lmb list entry contains information as layed out in the  */
static int of_get_drconf_memory(struct device_node *memory, const u32 **dm)
{
	const u32 *prop;
	u32 len, entries;
	prop = of_get_property(memory, "ibm,dynamic-memory", &len);
	if (!prop || len < sizeof(unsigned int))
		return 0;
	entries = *prop++;
	if (len < (entries * (n_mem_addr_cells + 4) + 1) * sizeof(unsigned int))
		return 0;
	*dm = prop;
	return entries;
}