[U-Boot] [PATCH] spi: soft_spi: Fix null ptr when probing soft_spi.

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Sat Dec 29 10:31:06 UTC 2018


Am Mi., 19. Dez. 2018 um 15:10 Uhr schrieb Horatiu Vultur
<horatiu.vultur at microchip.com>:
>
> When probing soft_spi the result of dev_get_parent_priv(dev) in probe
> function is null ptr because the spi is on the ahb bus which has
> per_child_auto_alloc_size set to 0. Therefore it would generate an Ooops
> messages when accessing spi_slave structure.
>
> The fix consist of delaying the read of dm_spi_slave_platdata until a
> child under the spi is probed, to be able to read SPI mode. Therefore
> implement .child_pre_probe in which updates soft_spi_platdata based on
> child dm_spi_slave_platdata.
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur at microchip.com>
> ---
>  drivers/spi/soft_spi.c | 24 +++++++++++++++++-------
>  1 file changed, 17 insertions(+), 7 deletions(-)
>

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>


More information about the U-Boot mailing list