From: Oleksij Rempel <o.rempel@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Oleksij Rempel <linux@rempel-privat.de>,
Shawn Guo <shawnguo@kernel.org>, Wolfram Sang <wsa@kernel.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible
Date: Wed, 14 Sep 2022 13:22:41 +0200 [thread overview]
Message-ID: <20220914112241.GC31791@pengutronix.de> (raw)
In-Reply-To: <20220912132040.156713-1-u.kleine-koenig@pengutronix.de>
On Mon, Sep 12, 2022 at 03:20:40PM +0200, Uwe Kleine-König wrote:
> pm_runtime_get_sync() returning 1 also means the device is powered. So
> resetting the chip registers in .remove() is possible and should be
> done.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: d98bdd3a5b50 ("i2c: imx: Make sure to unregister adapter on remove()")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Thank you!
> ---
> drivers/i2c/busses/i2c-imx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index e47fa3465671..3082183bd66a 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -1583,7 +1583,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
> if (i2c_imx->dma)
> i2c_imx_dma_free(i2c_imx);
>
> - if (ret == 0) {
> + if (ret >= 0) {
> /* setup chip registers to defaults */
> imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR);
> imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR);
> --
> 2.37.2
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2022-09-14 11:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 13:20 [PATCH] i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible Uwe Kleine-König
2022-09-14 11:22 ` Oleksij Rempel [this message]
2022-09-16 19:38 ` Wolfram Sang
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=20220914112241.GC31791@pengutronix.de \
--to=o.rempel@pengutronix.de \
--cc=dan.carpenter@oracle.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux@rempel-privat.de \
--cc=shawnguo@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wsa@kernel.org \
/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