[U-Boot] [PATCH v3 02/15] sysreset-uclass: ensure udevice is probed before requesting reset

Simon Glass
2017-04-19T00:13:00Z

Hi Alvaro,

On 18 April 2017 at 14:38, Álvaro Fernández Rojas <noltari@gmail.com> wrote:
> This causes exceptions for drivers that aren't probed when reboot is
> requested.
>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
> v3: add new patch to ensure that the device is probed
>
> drivers/sysreset/sysreset-uclass.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c
> index 3566d17..329dc2e 100644
> --- a/drivers/sysreset/sysreset-uclass.c
> +++ b/drivers/sysreset/sysreset-uclass.c
> @@ -34,6 +34,9 @@ int sysreset_walk(enum sysreset_t type)
> for (uclass_first_device(UCLASS_SYSRESET, &dev);
> dev;
> uclass_next_device(&dev)) {
> + if (!device_active(dev) && device_probe(dev))
> + continue;

uclass_first_device() should activate the device. Can you please dig
into what is going on here?

> +
> ret = sysreset_request(dev, type);
> if (ret == -EINPROGRESS)
> break;
> --
> 2.1.4
>

Regards,
Simon