Bluetooth: hci_qca: Remove duplicate power off in proto close
authorVenkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
Thu, 10 Sep 2020 10:30:43 +0000 (16:00 +0530)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 11 Sep 2020 07:09:48 +0000 (09:09 +0200)
During serdev unregister, hdev->shutdown is called before
proto close. Removing duplicates power OFF call.

Signed-off-by: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_qca.c

index 6577356..244b8fe 100644 (file)
@@ -693,8 +693,6 @@ static int qca_close(struct hci_uart *hu)
        destroy_workqueue(qca->workqueue);
        qca->hu = NULL;
 
-       qca_power_shutdown(hu);
-
        kfree_skb(qca->rx_skb);
 
        hu->priv = NULL;
@@ -2031,8 +2029,9 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 static void qca_serdev_remove(struct serdev_device *serdev)
 {
        struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
+       struct qca_power *power = qcadev->bt_power;
 
-       if (qca_is_wcn399x(qcadev->btsoc_type))
+       if (qca_is_wcn399x(qcadev->btsoc_type) && power->vregs_on)
                qca_power_shutdown(&qcadev->serdev_hu);
        else if (qcadev->susclk)
                clk_disable_unprepare(qcadev->susclk);