nvme: Fix error code and log to indicate busy
Return -EBUSY if controller is found busy rather than -ENOMEM
and update the error message accordingly.
Fixes: 982388eaa991 ("nvme: Add NVM Express driver support")
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index c39cd41..ec45f83 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -835,8 +835,8 @@
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;
}