]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
habanalabs: show correct id in error print
authorOded Gabbay <oded.gabbay@gmail.com>
Sun, 1 Sep 2019 13:13:25 +0000 (16:13 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 5 Sep 2019 11:55:28 +0000 (14:55 +0300)
If the initialization of a device failed, the driver prints an error
message with the id of the device. The device index on the file system is
that id divided by 2.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Omer Shpigelman <oshpigelman@habana.ai>
drivers/misc/habanalabs/device.c

index cebdceb72298ac3231413f28cfc0acd9cf51958d..459fee70a597a8fa0fc82e8225448fd3afacc508 100644 (file)
@@ -1292,10 +1292,10 @@ out_disabled:
        if (hdev->pdev)
                dev_err(&hdev->pdev->dev,
                        "Failed to initialize hl%d. Device is NOT usable !\n",
-                       hdev->id);
+                       hdev->id / 2);
        else
                pr_err("Failed to initialize hl%d. Device is NOT usable !\n",
-                       hdev->id);
+                       hdev->id / 2);
 
        return rc;
 }