Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611155

[PATCHv3 07/10] Bluetooth: hci_serdev: do not open device in hci open

From Sebastian Reichel <sre@kernel.org>
Newsgroups linux.kernel
Subject [PATCHv3 07/10] Bluetooth: hci_serdev: do not open device in hci open
Date 2017-03-28 18:10 +0200
Message-ID <tq1R1-1HW-53@gated-at.bofh.it> (permalink)
References <tq1QZ-1HW-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The device driver may need to communicate with the UART
device while the Bluetooth device is closed (e.g. due
to interrupts).

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/bluetooth/hci_serdev.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c
index f5ccb2c7ef92..3b8ac0ece3fb 100644
--- a/drivers/bluetooth/hci_serdev.c
+++ b/drivers/bluetooth/hci_serdev.c
@@ -104,13 +104,9 @@ static void hci_uart_write_work(struct work_struct *work)
 /* Initialize device */
 static int hci_uart_open(struct hci_dev *hdev)
 {
-	struct hci_uart *hu  = hci_get_drvdata(hdev);
-
 	BT_DBG("%s %p", hdev->name, hdev);
 
-	serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);
-
-	return serdev_device_open(hu->serdev);
+	return 0;
 }
 
 /* Reset device */
@@ -136,15 +132,11 @@ static int hci_uart_flush(struct hci_dev *hdev)
 /* Close device */
 static int hci_uart_close(struct hci_dev *hdev)
 {
-	struct hci_uart *hu  = hci_get_drvdata(hdev);
-
 	BT_DBG("hdev %p", hdev);
 
 	hci_uart_flush(hdev);
 	hdev->flush = NULL;
 
-	serdev_device_close(hu->serdev);
-
 	return 0;
 }
 
@@ -289,6 +281,8 @@ int hci_uart_register_device(struct hci_uart *hu,
 
 	BT_DBG("");
 
+	serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);
+
 	err = p->open(hu);
 	if (err)
 		return err;
-- 
2.11.0

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv3 00/10] Nokia H4+ support Sebastian Reichel <sre@kernel.org> - 2017-03-28 18:10 +0200
  [PATCHv3 07/10] Bluetooth: hci_serdev: do not open device in hci open Sebastian Reichel <sre@kernel.org> - 2017-03-28 18:10 +0200
  Re: [PATCHv3 00/10] Nokia H4+ support Rob Herring <robh+dt@kernel.org> - 2017-03-29 23:20 +0200
    Re: [PATCHv3 00/10] Nokia H4+ support Marcel Holtmann <marcel@holtmann.org> - 2017-03-29 23:40 +0200
      Re: [PATCHv3 00/10] Nokia H4+ support Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-31 15:40 +0200
        Re: [PATCHv3 00/10] Nokia H4+ support Rob Herring <robh+dt@kernel.org> - 2017-04-05 20:20 +0200
          Re: [PATCHv3 00/10] Nokia H4+ support Pavel Machek <pavel@ucw.cz> - 2017-04-05 22:30 +0200

csiph-web