From: Jonathan Cameron <jic23@kernel.org>
To: David Heidelberg via B4 Relay <devnull+david.ixit.cz@kernel.org>
Cc: david@ixit.cz, Lars-Peter Clausen <lars@metafoo.de>,
Svyatoslav Ryhel <clamor95@gmail.com>,
Robert Eckelmann <longnoserob@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 09/13] iio: light: al3010: Move devm_add_action_or_reset back to _probe
Date: Sun, 30 Mar 2025 18:34:28 +0100 [thread overview]
Message-ID: <20250330183428.454f846d@jic23-huawei> (raw)
In-Reply-To: <20250319-al3010-iio-regmap-v2-9-1310729d0543@ixit.cz>
On Wed, 19 Mar 2025 21:59:48 +0100
David Heidelberg via B4 Relay <devnull+david.ixit.cz@kernel.org> wrote:
> From: David Heidelberg <david@ixit.cz>
>
> In a preparation to the regmap transition.
I'm not following the reasoning for this patch.
The setup action being unwound is done in _init()
and if we happen to get an error on the write immediately after
where it currently is, we no longer power down the device.
>
> Improve error handling using dev_err_probe().
>
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> drivers/iio/light/al3010.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/light/al3010.c b/drivers/iio/light/al3010.c
> index 8c004a9239aef246a8c6f6c3f4acd6b760ee8249..8098c92c9572befe92d00ef0785ded5e1a08d587 100644
> --- a/drivers/iio/light/al3010.c
> +++ b/drivers/iio/light/al3010.c
> @@ -89,12 +89,6 @@ static int al3010_init(struct al3010_data *data)
> if (ret < 0)
> return ret;
>
> - ret = devm_add_action_or_reset(&data->client->dev,
> - al3010_set_pwr_off,
> - data);
> - if (ret < 0)
> - return ret;
> -
> ret = i2c_smbus_write_byte_data(data->client, AL3010_REG_CONFIG,
> FIELD_PREP(AL3010_GAIN_MASK,
> AL3XXX_RANGE_3));
> @@ -195,6 +189,10 @@ static int al3010_probe(struct i2c_client *client)
> return ret;
> }
>
> + ret = devm_add_action_or_reset(dev, al3010_set_pwr_off, data);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to add action\n");
> +
> return devm_iio_device_register(dev, indio_dev);
> }
>
>
next prev parent reply other threads:[~2025-03-30 17:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 20:59 [PATCH v2 00/13] iio: light: Modernize al3010 and al3320a codebase David Heidelberg via B4 Relay
2025-03-19 20:59 ` [PATCH v2 01/13] iio: light: al3010: Use unsigned int for the indexing David Heidelberg via B4 Relay
2025-03-30 17:26 ` Jonathan Cameron
2025-03-19 20:59 ` [PATCH v2 02/13] iio: light: al3320a: " David Heidelberg via B4 Relay
2025-03-19 20:59 ` [PATCH v2 03/13] iio: light: al3010: Remove DRV_NAME definition David Heidelberg via B4 Relay
2025-03-30 17:27 ` Jonathan Cameron
2025-03-19 20:59 ` [PATCH v2 04/13] iio: light: al3320a: " David Heidelberg via B4 Relay
2025-03-19 20:59 ` [PATCH v2 05/13] iio: light: al3010: Abstract device reference in the probe function David Heidelberg via B4 Relay
2025-03-30 17:29 ` Jonathan Cameron
2025-03-19 20:59 ` [PATCH v2 06/13] iio: light: al3320a: " David Heidelberg via B4 Relay
2025-03-19 20:59 ` [PATCH v2 07/13] iio: light: al3010: Split set_pwr function into set_pwr_on and _off David Heidelberg via B4 Relay
2025-03-30 17:30 ` Jonathan Cameron
2025-03-19 20:59 ` [PATCH v2 08/13] iio: light: al3320a: " David Heidelberg via B4 Relay
2025-03-19 20:59 ` [PATCH v2 09/13] iio: light: al3010: Move devm_add_action_or_reset back to _probe David Heidelberg via B4 Relay
2025-03-30 17:34 ` Jonathan Cameron [this message]
2025-04-01 16:36 ` David Heidelberg
2025-03-19 20:59 ` [PATCH v2 10/13] iio: light: al3010: Improve al3010_init error handling with dev_err_probe David Heidelberg via B4 Relay
2025-03-30 17:36 ` Jonathan Cameron
2025-03-19 20:59 ` [PATCH v2 11/13] iio: light: al3320a: Improve " David Heidelberg via B4 Relay
2025-03-30 17:38 ` Jonathan Cameron
2025-03-19 20:59 ` [PATCH v2 12/13] iio: light: al3010: Implement regmap support David Heidelberg via B4 Relay
2025-03-30 17:45 ` Jonathan Cameron
2025-03-30 17:47 ` Jonathan Cameron
2025-03-19 20:59 ` [PATCH v2 13/13] iio: light: al3320a: " David Heidelberg via B4 Relay
2025-03-30 17:48 ` Jonathan Cameron
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=20250330183428.454f846d@jic23-huawei \
--to=jic23@kernel.org \
--cc=clamor95@gmail.com \
--cc=david@ixit.cz \
--cc=devnull+david.ixit.cz@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longnoserob@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