From 307eae93d5ce3316b4c728408283da957350b2a8 Mon Sep 17 00:00:00 2001 From: Oded Gabbay Date: Sun, 1 Sep 2019 16:13:25 +0300 Subject: [PATCH] habanalabs: show correct id in error print 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 Reviewed-by: Omer Shpigelman --- drivers/misc/habanalabs/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c index cebdceb72298..459fee70a597 100644 --- a/drivers/misc/habanalabs/device.c +++ b/drivers/misc/habanalabs/device.c @@ -1292,10 +1292,10 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass) 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; }