On Wed, 22 Nov 2023 at 16:52, Moritz Fischer <mori...@google.com> wrote:
>
> Return -EBUSY if controller is found busy rather than -ENOMEM

-ENODEV ?

> and update the error message accordingly.
>
> Fixes: 982388eaa991 ("nvme: Add NVM Express driver support")
> Signed-off-by: Moritz Fischer <mori...@google.com>
> ---
>  drivers/nvme/nvme.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <s...@chromium.org>


>
> diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
> index c39cd41aa3..ec45f831a3 100644
> --- a/drivers/nvme/nvme.c
> +++ b/drivers/nvme/nvme.c
> @@ -835,8 +835,8 @@ int nvme_init(struct udevice *udev)
>         ndev->udev = udev;
>         INIT_LIST_HEAD(&ndev->namespaces);
>         if (readl(&ndev->bar->csts) == -1) {
> -               ret = -ENODEV;
> -               printf("Error: %s: Out of memory!\n", udev->name);
> +               ret = -EBUSY;
> +               printf("Error: %s: Controller not ready!\n", udev->name);
>                 goto free_nvme;
>         }
>
> --
> 2.43.0.rc1.413.gea7ed67945-goog
>

Reply via email to