lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed,  1 Jun 2016 15:27:10 +0800
From:	Wei-Ning Huang <wnhuang@...omium.org>
To:	Linux Bluetooth <linux-bluetooth@...r.kernel.org>
Cc:	LKML <linux-kernel@...r.kernel.org>, akarwar@...vell.com,
	Wei-Ning Huang <wnhuang@...omium.org>
Subject: [PATCH v2] Bluetooth: btmrvl_main: read wakeup-pin and wakeup-gap-ms as u32

The dt binding document for Marvell bt-sd8897 specify the
'marvell,wakeup-pin' and 'marvell,wakeup-gap-ms' attributes to be a 32-bit
value, but the driver parse it as 16-bit instead. Fix this to meet the
dt-binding document, and to be consistent with the 'marvell,wakeup-pin'
property in the mwifiex driver.

Signed-off-by: Wei-Ning Huang <wnhuang@...omium.org>
---
 drivers/bluetooth/btmrvl_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 7ad8d61..b6d3404 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -513,21 +513,21 @@ static int btmrvl_check_device_tree(struct btmrvl_private *priv)
 	struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
 	u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE];
 	int ret = 0;
-	u16 gpio, gap;
+	u32 gpio, gap;
 
 	if (card->plt_of_node) {
 		dt_node = card->plt_of_node;
-		ret = of_property_read_u16(dt_node, "marvell,wakeup-pin",
+		ret = of_property_read_u32(dt_node, "marvell,wakeup-pin",
 					   &gpio);
 		if (ret)
 			gpio = (priv->btmrvl_dev.gpio_gap & 0xff00) >> 8;
 
-		ret = of_property_read_u16(dt_node, "marvell,wakeup-gap-ms",
+		ret = of_property_read_u32(dt_node, "marvell,wakeup-gap-ms",
 					   &gap);
 		if (ret)
 			gap = (u8)(priv->btmrvl_dev.gpio_gap & 0x00ff);
 
-		priv->btmrvl_dev.gpio_gap = (gpio << 8) + gap;
+		priv->btmrvl_dev.gpio_gap = ((gpio & 0xff) << 8) + (gap & 0xff);
 
 		ret = of_property_read_u8_array(dt_node, "marvell,cal-data",
 						cal_data + BT_CAL_HDR_LEN,
-- 
2.1.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ