/* The layout of the ibm,associativity-lookup-arrays property is a number N indicating the number of associativity arrays, followed by a number M indicating the size of each associativity array, followed by a list of N associativity arrays.  */
static int of_get_assoc_arrays(struct device_node *memory, struct assoc_arrays *aa)
/* The layout of the ibm,associativity-lookup-arrays property is a number N indicating the number of associativity arrays, followed by a number M indicating the size of each associativity array, followed by a list of N associativity arrays.  */
static int of_get_assoc_arrays(struct device_node *memory, struct assoc_arrays *aa)
{
	const u32 *prop;
	u32 len;
	prop = of_get_property(memory, "ibm,associativity-lookup-arrays", &len);
	if (!prop || len < 2 * sizeof(unsigned int))
		return -1;
	aa->n_arrays = *prop++;
	aa->array_sz = *prop++;
	if (len < (aa->n_arrays * aa->array_sz + 2) * sizeof(unsigned int))
		return -1;
	aa->arrays = prop;
	return 0;
}