Bluetooth: btmtkuart: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
authorZhang Qilong <zhangqilong3@huawei.com>
Mon, 31 May 2021 14:24:49 +0000 (22:24 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 26 Jun 2021 05:12:38 +0000 (07:12 +0200)
Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btmtkuart.c

index 6c40bc75fb5b8d5c9798f4bbbcb6a1d82b087d71..e9d91d7c0db48de8794eb68faf72244c0181d46a 100644 (file)
@@ -581,11 +581,9 @@ static int btmtkuart_open(struct hci_dev *hdev)
 
        /* Enable the power domain and clock the device requires */
        pm_runtime_enable(dev);
-       err = pm_runtime_get_sync(dev);
-       if (err < 0) {
-               pm_runtime_put_noidle(dev);
+       err = pm_runtime_resume_and_get(dev);
+       if (err < 0)
                goto err_disable_rpm;
-       }
 
        err = clk_prepare_enable(bdev->clk);
        if (err < 0)