2019-09-02 07:51:49

by Oded Gabbay

[permalink] [raw]
Subject: [PATCH 2/2] 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 <[email protected]>
---
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 bc98032cc4ec..e9f5a0e45183 100644
--- a/drivers/misc/habanalabs/device.c
+++ b/drivers/misc/habanalabs/device.c
@@ -1290,10 +1290,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;
}
--
2.17.1


2019-09-02 08:53:58

by Omer Shpigelman

[permalink] [raw]
Subject: RE: [PATCH 2/2] habanalabs: show correct id in error print

From: Oded Gabbay <[email protected]>
Sent: Monday, 2 September 2019 10:50

> 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 <[email protected]>

Reviewed-by: Omer Shpigelman <[email protected]>