mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Cc: "Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
	"Jonathan Cameron" <jic23@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,
	"Jonathan Marek" <jonathan@marek.ca>,
	"Brian Masney" <masneyb@onstation.org>,
	"Rob Herring" <robh@kernel.org>
Subject: Re: [PATCH v2 2/3] iio: imu: inv_mpu6050: control vdd supply using devm-helpers
Date: Wed, 1 Apr 2026 18:10:16 +0300	[thread overview]
Message-ID: <ac01WETv_jIcYvRL@ashevche-desk.local> (raw)
In-Reply-To: <20260401082737.781018-3-andrej.skvortzov@gmail.com>

On Wed, Apr 01, 2026 at 11:27:36AM +0300, Andrey Skvortsov wrote:
> vdd supply will be automatically disabled on error condition during a
> probe and on driver cleanup. Since the vdd handling is moved to
> devm-helpers, only vddio regulator has to be disabled in the
> driver-specific cleanup action.

...

> -static void inv_mpu_core_disable_regulator_action(void *_data)
> +static void inv_mpu_core_disable_regulator_vddio_action(void *_data)

You can rename now _data --> st...

>  {
>  	struct inv_mpu6050_state *st = _data;

...and drop this.

>  	inv_mpu_core_disable_regulator_vddio(st);
>  }

...

> -	st->vdd_supply = devm_regulator_get(dev, "vdd");
> -	if (IS_ERR(st->vdd_supply))
> -		return dev_err_probe(dev, PTR_ERR(st->vdd_supply),
> -				     "Failed to get vdd regulator\n");
> -
>  	st->vddio_supply = devm_regulator_get(dev, "vddio");
>  	if (IS_ERR(st->vddio_supply))
>  		return dev_err_probe(dev, PTR_ERR(st->vddio_supply),
>  				     "Failed to get vddio regulator\n");
>  
> -	result = regulator_enable(st->vdd_supply);
> -	if (result) {
> -		dev_err(dev, "Failed to enable vdd regulator: %d\n", result);
> -		return result;
> -	}
> +	result = devm_regulator_get_enable(dev, "vdd");
> +	if (result)
> +		return dev_err_probe(dev, result, "Failed to enable vdd regulator\n");

I'm not that expert in regulator framework, but this change might be sensitive.
I dunno if regulator is exclusive or shared and if order of requesting may affect
anything. Just needs careful review from somebody more familiar with that.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-04-01 15:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01  8:27 [PATCH v2 0/3] iio: imu: inv_mpu6050: runtime pm fixes Andrey Skvortsov
2026-04-01  8:27 ` [PATCH v2 1/3] iio: imu: inv_mpu6050: use devres-enabled version of pm_runtime_enable Andrey Skvortsov
2026-04-01 15:00   ` Andy Shevchenko
2026-04-10 23:12   ` David Lechner
2026-04-01  8:27 ` [PATCH v2 2/3] iio: imu: inv_mpu6050: control vdd supply using devm-helpers Andrey Skvortsov
2026-04-01 15:10   ` Andy Shevchenko [this message]
2026-04-06  6:53     ` Andrey Skvortsov
2026-04-06 19:16       ` Andy Shevchenko
2026-04-01  8:27 ` [PATCH v2 3/3] iio: imu: inv_mpu6050: fix unbalanced regulator_disable calls, when probe fails Andrey Skvortsov
2026-04-11 13:22   ` Nuno Sá
2026-04-16 22:21     ` Andrey Skvortsov

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=ac01WETv_jIcYvRL@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andrej.skvortzov@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=jonathan@marek.ca \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masneyb@onstation.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@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

all inboxes | Powered by JetHome®