diff mbox series

[v1] Bluetooth: btnxpuart: Fix compile errors due to BTNXPUART

Message ID 20250307080907.218398-1-neeraj.sanjaykale@nxp.com
State New
Headers show
Series [v1] Bluetooth: btnxpuart: Fix compile errors due to BTNXPUART | expand

Commit Message

Neeraj Sanjay Kale March 7, 2025, 8:09 a.m. UTC
This fixes compilation errors seen due to merging recent patches.

hdev->cmd_timeout was recently renamed to hdev->reset in following
commit:
commit f07d478090b0 ("Bluetooth: Get rid of cmd_timeout and use the reset
callback")

Renamed nxp_cmd_timeout() to nxp_reset() accordingly.

In latest master, the check for "local-bd-address" device property seems
to be missing. Added the missing code in the patch.

Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503070951.EcxRrnHK-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202503071045.5Ac2pLEW-lkp@intel.com/
---
 drivers/bluetooth/btnxpuart.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index abe2ccd92604..b3454227c7c6 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1318,8 +1318,8 @@  static int nxp_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
 	/* BD address can be assigned only after first reset command. */
 	err = __hci_cmd_sync_status(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
 	if (err) {
-		bt_dev_err(hdev, "Reset before setting local-bd-addr failed (%ld)",
-			   PTR_ERR(skb));
+		bt_dev_err(hdev, "Reset before setting local-bd-addr failed (%d)",
+			   err);
 		return err;
 	}
 
@@ -1422,7 +1422,7 @@  static bool nxp_wakeup(struct hci_dev *hdev)
 	return false;
 }
 
-static void nxp_cmd_timeout(struct hci_dev *hdev)
+static void nxp_reset(struct hci_dev *hdev)
 {
 	struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
 
@@ -1721,9 +1721,15 @@  static int nxp_serdev_probe(struct serdev_device *serdev)
 	hdev->shutdown = nxp_shutdown;
 	hdev->wakeup = nxp_wakeup;
 	hdev->set_bdaddr = nxp_set_bdaddr;
-	hdev->cmd_timeout = nxp_cmd_timeout;
+	hdev->reset = nxp_reset;
 	SET_HCIDEV_DEV(hdev, &serdev->dev);
 
+	device_property_read_u8_array(&nxpdev->serdev->dev,
+				      "local-bd-address",
+				      (u8 *)&ba, sizeof(ba));
+	if (bacmp(&ba, BDADDR_ANY))
+		set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
+
 	if (hci_register_dev(hdev) < 0) {
 		dev_err(&serdev->dev, "Can't register HCI device\n");
 		goto probe_fail;