mtd: rawnand: gpmi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
authorZhang Qilong <zhangqilong3@huawei.com>
Thu, 22 Sep 2022 15:06:54 +0000 (23:06 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 18 Oct 2022 08:27:06 +0000 (10:27 +0200)
Using the newest pm_runtime_resume_and_get is more appropriate
for simplifing code here.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220922150654.117568-1-zhangqilong3@huawei.com
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

index 01ccbde..ada8334 100644 (file)
@@ -148,11 +148,9 @@ static int gpmi_init(struct gpmi_nand_data *this)
        struct resources *r = &this->resources;
        int ret;
 
-       ret = pm_runtime_get_sync(this->dev);
-       if (ret < 0) {
-               pm_runtime_put_noidle(this->dev);
+       ret = pm_runtime_resume_and_get(this->dev);
+       if (ret < 0)
                return ret;
-       }
 
        ret = gpmi_reset_block(r->gpmi_regs, false);
        if (ret)
@@ -2504,11 +2502,9 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip,
        for (i = 0; i < GPMI_MAX_TRANSFERS; i++)
                this->transfers[i].direction = DMA_NONE;
 
-       ret = pm_runtime_get_sync(this->dev);
-       if (ret < 0) {
-               pm_runtime_put_noidle(this->dev);
+       ret = pm_runtime_resume_and_get(this->dev);
+       if (ret < 0)
                return ret;
-       }
 
        /*
         * This driver currently supports only one NAND chip. Plus, dies share