[PATCH] powerpc: add of_find_next_property and of_get_aliased_index

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Jun 26 20:57:44 EST 2008


> +struct property *of_find_next_property(const struct device_node *np,
> +	struct property *prev)
> +{
> +	struct property *next;
> +
> +	if (!np)
> +		return NULL;
> +
> +	read_lock(&devtree_lock);
> +	next = prev ? prev->next : np->properties;
> +	read_unlock(&devtree_lock);
> +
> +	return next;
> +}

Unfortunately, this isn't race free vs. removal or addition of
properties. This is fine with the intended usage (ie. retreiving
aliases) but at least that should be explained in a comment.

Cheers,
Ben.





More information about the Linuxppc-dev mailing list