Skip to content

Commit

Permalink
habanalabs: show correct id in error print
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oded Gabbay committed Sep 5, 2019
1 parent 4c172bb commit 307eae9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/habanalabs/device.c
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 307eae9

Please sign in to comment.