[PATCH] Fix endian safe issue, make driver work on both little and big endian cpu.

Subsystems: bluetooth drivers, the rest

STALE4567d

2 messages, 2 authors, 2014-03-07 · open the first message on its own page

[PATCH] Fix endian safe issue, make driver work on both little and big endian cpu.

From: Peng Chen <hidden>
Date: 2012-09-06 11:30:43

Signed-off-by: Peng Chen <redacted>
---
 drivers/bluetooth/ath3k.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 10308cd..e63aee1 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -299,7 +299,7 @@ static int ath3k_load_patch(struct usb_device *udev)
 	}
 
 	snprintf(filename, ATH3K_NAME_LEN, "ar3k/AthrBT_0x%08x.dfu",
-		fw_version.rom_version);
+		le32_to_cpu(fw_version.rom_version));
 
 	ret = request_firmware(&firmware, filename, &udev->dev);
 	if (ret < 0) {
@@ -361,7 +361,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
 	}
 
 	snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s",
-		fw_version.rom_version, clk_value, ".dfu");
+		le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
 
 	ret = request_firmware(&firmware, filename, &udev->dev);
 	if (ret < 0) {
-- 
1.7.9.5

Re: [PATCH] Fix endian safe issue, make driver work on both little and big endian cpu.

From: Johan Hedberg <hidden>
Date: 2014-03-07 18:13:17

Hi,

On Thu, Sep 06, 2012, Peng Chen wrote:
Signed-off-by: Peng Chen <redacted>
---
 drivers/bluetooth/ath3k.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to bluetooth-next. Thanks.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help