[U-Boot] [PATCH] w1-eeprom: ds24xxx: fix data abort in ds24xxx_probe()

Eugen.Hristev at microchip.com Eugen.Hristev at microchip.com
Tue Oct 23 06:51:59 UTC 2018



On 22.10.2018 19:31, Martin Fuzzey wrote:
> Data abort was occurring when using "w1 bus" with a DS24B33 present.
> 
> The abort occurred in the ds24xxx_probe() because the struct w1_device
> pointer was NULL. This is because that structure  is allocated by
> the parent device uclass (by .per_child_platdata_auto_alloc_size)
> and thus the correct accessor is dev_get_parent_platdata() not
> dev_get_platdata()
> 
> Signed-off-by: Martin Fuzzey <martin.fuzzey at flowbird.group>

Reviewed-by: Eugen Hristev <eugen.hristev at microchip.com>

Hi Martin,

At some point during development I switched from holding the data in 
platdata to parent platdata, and this slipped.

Thanks for the fix.
Eugen

> ---
>   drivers/w1-eeprom/ds24xxx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/w1-eeprom/ds24xxx.c b/drivers/w1-eeprom/ds24xxx.c
> index 56186e5..0967acc 100644
> --- a/drivers/w1-eeprom/ds24xxx.c
> +++ b/drivers/w1-eeprom/ds24xxx.c
> @@ -31,7 +31,7 @@ static int ds24xxx_probe(struct udevice *dev)
>   {
>   	struct w1_device *w1;
>   
> -	w1 = dev_get_platdata(dev);
> +	w1 = dev_get_parent_platdata(dev);
>   	w1->id = 0;
>   	return 0;
>   }
> 


More information about the U-Boot mailing list