Commit 78e2d541 authored by Zhang Qilong's avatar Zhang Qilong Committed by Miquel Raynal
Browse files

mtd: rawnand: gpmi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync



Using the newest pm_runtime_resume_and_get is more appropriate
for simplifing code here.

Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220922150654.117568-1-zhangqilong3@huawei.com
parent 47c3697e
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -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