mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Erikas Bitovtas <xerikasxx@gmail.com>
Cc: "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
Subject: Re: [PATCH v2 4/6] iio: light: vcnl4000: move power state function into device-managed action
Date: Thu, 9 Apr 2026 12:34:58 +0300	[thread overview]
Message-ID: <addywsAU2ku-s_tY@ashevche-desk.local> (raw)
In-Reply-To: <20260405-vcnl4000-drop-enum-v2-4-7c8dc98c3974@gmail.com>

On Sun, Apr 05, 2026 at 07:08:41PM +0300, Erikas Bitovtas wrote:
> Move power state setting into a device-managed action to get rid of
> fail_poweroff goto label and remove it from vcnl4000_remove() function.

...

>  static int vcnl4000_probe(struct i2c_client *client)
>  {

> +	ret = devm_add_action_or_reset(dev, vcnl4000_cleanup, indio_dev);
> +	if (ret)
> +		return ret;

>  	ret = pm_runtime_set_active(dev);
>  	if (ret < 0)
> -		goto fail_poweroff;
> +		return ret;
>  
>  	ret = iio_device_register(indio_dev);
>  	if (ret < 0)
> -		goto fail_poweroff;

Shouldn't we undo the _set_active()?

> +		return ret;
>  
>  	pm_runtime_enable(dev);
>  	pm_runtime_set_autosuspend_delay(dev, VCNL4000_SLEEP_DELAY_MS);
>  	pm_runtime_use_autosuspend(dev);
>  
>  	return 0;

>  }

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-04-09  9:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-05 16:08 [PATCH v2 0/6] iio: light: vcnl4000: drop enum ID table and use device-managed register Erikas Bitovtas
2026-04-05 16:08 ` [PATCH v2 1/6] iio: light: vcnl4000: validate device by prod ID instead of table ID Erikas Bitovtas
2026-04-09  9:31   ` Andy Shevchenko
2026-04-05 16:08 ` [PATCH v2 2/6] iio: light: vcnl4000: move device tree entries into one line Erikas Bitovtas
2026-04-09  9:29   ` Andy Shevchenko
2026-04-05 16:08 ` [PATCH v2 3/6] iio: light: vcnl4000: drop enum id table in favor of chip structs Erikas Bitovtas
2026-04-05 16:08 ` [PATCH v2 4/6] iio: light: vcnl4000: move power state function into device-managed action Erikas Bitovtas
2026-04-09  9:34   ` Andy Shevchenko [this message]
2026-04-05 16:08 ` [PATCH v2 5/6] iio: light: vcnl4000: make pm_runtime_enable() device-managed Erikas Bitovtas
2026-04-09  9:38   ` Andy Shevchenko
2026-04-05 16:08 ` [PATCH v2 6/6] iio: light: vcnl4000: register an IIO device with a device-managed function Erikas Bitovtas

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=addywsAU2ku-s_tY@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=xerikasxx@gmail.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®