[PATCH 5/9] OF: base: use of_platform_populate for probing

Sascha Hauer s.hauer at pengutronix.de
Sat Jun 29 10:22:40 EDT 2013


On Tue, Jun 25, 2013 at 11:20:43AM +0200, Sebastian Hesselbarth wrote:
> With recent bus/device related functions in OF API, we can now
> convert to use of_platform_populate.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
> ---
> Cc: barebox at lists.infradead.org
> ---
>  drivers/of/base.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 429f924..eb9ac84 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1840,7 +1840,7 @@ const struct of_device_id of_default_bus_match_table[] = {
>  
>  int of_probe(void)
>  {
> -	struct device_node *memory, *n;
> +	struct device_node *memory;
>  
>  	if(!root_node)
>  		return -ENODEV;
> @@ -1854,8 +1854,7 @@ int of_probe(void)
>  	if (memory)
>  		of_add_memory(memory, false);
>  
> -	list_for_each_entry(n, &root_node->children, parent_list)
> -		__of_probe(n, of_default_bus_match_table, NULL);
> +	of_platform_populate(root_node, of_default_bus_match_table, NULL);

This patch breaks the SPI chip select gpios on my efikasb. Problem is
that of_get_named_gpio depends on the device pointer in struct
device_node which of_platform_populate doesn't set. A quick test adding
the pointer in of_platform_device_create fixed this.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list