mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: "Linus Walleij" <linusw@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: gyro: mpu3050-i2c: use pm_runtime_resume_and_get()
Date: Sat, 31 Jan 2026 16:41:35 +0000	[thread overview]
Message-ID: <20260131164135.35f07a27@jic23-huawei> (raw)
In-Reply-To: <20260130153227.213413-1-antoniu.miclaus@analog.com>

On Fri, 30 Jan 2026 17:32:26 +0200
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> Use pm_runtime_resume_and_get() in bypass_select() and return its
> result directly. Unlike pm_runtime_get_sync(), it doesn't increment
> the refcount on failure.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>

Please always put a cover letter on anything with more than one patch.
Provides both a nice name for the series in patchwork etc and a 
single place to reply.

Are these fixes?  What is side effect of the wrong ref count?

> ---
>  drivers/iio/gyro/mpu3050-i2c.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c
> index 092878f2c886..6549b22e643d 100644
> --- a/drivers/iio/gyro/mpu3050-i2c.c
> +++ b/drivers/iio/gyro/mpu3050-i2c.c
> @@ -19,8 +19,7 @@ static int mpu3050_i2c_bypass_select(struct i2c_mux_core *mux, u32 chan_id)
>  	struct mpu3050 *mpu3050 = i2c_mux_priv(mux);
>  
>  	/* Just power up the device, that is all that is needed */
> -	pm_runtime_get_sync(mpu3050->dev);
> -	return 0;
> +	return pm_runtime_resume_and_get(mpu3050->dev);
>  }
>  
>  static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id)


  parent reply	other threads:[~2026-01-31 16:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 15:32 Antoniu Miclaus
2026-01-30 15:32 ` [PATCH] iio: gyro: mpu3050-core: " Antoniu Miclaus
2026-02-03  0:21   ` Linus Walleij
2026-01-31 16:41 ` Jonathan Cameron [this message]
2026-02-03  9:39   ` [PATCH] iio: gyro: mpu3050-i2c: " Nuno Sá
2026-02-03 11:13 ` Andy Shevchenko

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=20260131164135.35f07a27@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=linusw@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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

all inboxes | Powered by JetHome®