hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/bluetooth/btqcomsmd.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2016, Linaro Ltd.
34 * Copyright (c) 2015, Sony Mobile Communications Inc.
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 and
7
- * only version 2 as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
135 */
146
157 #include <linux/module.h>
....@@ -28,7 +20,6 @@
2820 struct btqcomsmd {
2921 struct hci_dev *hdev;
3022
31
- bdaddr_t bdaddr;
3223 struct rpmsg_endpoint *acl_channel;
3324 struct rpmsg_endpoint *cmd_channel;
3425 };
....@@ -116,32 +107,17 @@
116107
117108 static int btqcomsmd_setup(struct hci_dev *hdev)
118109 {
119
- struct btqcomsmd *btq = hci_get_drvdata(hdev);
120110 struct sk_buff *skb;
121
- int err;
122111
123112 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
124113 if (IS_ERR(skb))
125114 return PTR_ERR(skb);
126115 kfree_skb(skb);
127116
128
- /* Devices do not have persistent storage for BD address. If no
129
- * BD address has been retrieved during probe, mark the device
130
- * as having an invalid BD address.
117
+ /* Devices do not have persistent storage for BD address. Retrieve
118
+ * it from the firmware node property.
131119 */
132
- if (!bacmp(&btq->bdaddr, BDADDR_ANY)) {
133
- set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
134
- return 0;
135
- }
136
-
137
- /* When setting a configured BD address fails, mark the device
138
- * as having an invalid BD address.
139
- */
140
- err = qca_set_bdaddr_rome(hdev, &btq->bdaddr);
141
- if (err) {
142
- set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
143
- return 0;
144
- }
120
+ set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
145121
146122 return 0;
147123 }
....@@ -169,15 +145,6 @@
169145 if (IS_ERR(btq->cmd_channel)) {
170146 ret = PTR_ERR(btq->cmd_channel);
171147 goto destroy_acl_channel;
172
- }
173
-
174
- /* The local-bd-address property is usually injected by the
175
- * bootloader which has access to the allocated BD address.
176
- */
177
- if (!of_property_read_u8_array(pdev->dev.of_node, "local-bd-address",
178
- (u8 *)&btq->bdaddr, sizeof(bdaddr_t))) {
179
- dev_info(&pdev->dev, "BD address %pMR retrieved from device-tree",
180
- &btq->bdaddr);
181148 }
182149
183150 hdev = hci_alloc_dev();