Skip to contentSkip to conversation

habanalabs: fix endianness when reading cpld version

PATCH New Oded Gabbay 1 participant 1 message Dec 16, 2021 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: fix endianness when reading cpld version

From: Ofir Bitton <[email protected]>

Current sysfs implementation does not take endianness into consideration when dumping the cpld version.

---
 drivers/misc/habanalabs/common/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/habanalabs/common/sysfs.c +1 -1
index 2f6de734ce37..1af568e46f46 100644
@@ -139,7 +139,7 @@ static ssize_t cpld_ver_show(struct device *dev, struct device_attribute *attr,
 	struct hl_device *hdev = dev_get_drvdata(dev);
 
 	return sprintf(buf, "0x%08x\n",
-			hdev->asic_prop.cpucp_info.cpld_version);
+			le32_to_cpu(hdev->asic_prop.cpucp_info.cpld_version));
 }
 
 static ssize_t cpucp_kernel_ver_show(struct device *dev,
Signature · 1 line
2.25.1