From: Miquel Raynal <miquel.raynal@bootlin.com>
To: cgel.zte@gmail.com
Cc: han.xu@nxp.com, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] mtd: nand: gpmi-nand: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Date: Tue, 19 Apr 2022 09:40:51 +0200 [thread overview]
Message-ID: <20220419094051.3bb9fe45@xps13> (raw)
In-Reply-To: <20220418105549.2558765-1-chi.minghao@zte.com.cn>
Hello,
cgel.zte@gmail.com wrote on Mon, 18 Apr 2022 10:55:49 +0000:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
Would you mind reducing a little bit the title of the commit? Othewise
fine by me.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
> drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> index 44b14c9dc9a7..6e7477aef8a7 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> @@ -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)
> @@ -544,11 +542,9 @@ static int bch_set_geometry(struct gpmi_nand_data *this)
> if (ret)
> return ret;
>
> - ret = pm_runtime_get_sync(this->dev);
> - if (ret < 0) {
> - pm_runtime_put_autosuspend(this->dev);
> + ret = pm_runtime_resume_and_get(this->dev);
> + if (ret < 0)
> return ret;
> - }
>
> /*
> * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this
> @@ -2286,11 +2282,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
Thanks,
Miquèl
prev parent reply other threads:[~2022-04-19 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 10:55 [PATCH] mtd: nand: gpmi-nand: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-04-19 7:40 ` Miquel Raynal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220419094051.3bb9fe45@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=han.xu@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox