lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250330183428.454f846d@jic23-huawei>
Date: Sun, 30 Mar 2025 18:34:28 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: David Heidelberg via B4 Relay <devnull+david.ixit.cz@...nel.org>
Cc: david@...t.cz, Lars-Peter Clausen <lars@...afoo.de>, Svyatoslav Ryhel
 <clamor95@...il.com>, Robert Eckelmann <longnoserob@...il.com>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 09/13] iio: light: al3010: Move
 devm_add_action_or_reset back to _probe

On Wed, 19 Mar 2025 21:59:48 +0100
David Heidelberg via B4 Relay <devnull+david.ixit.cz@...nel.org> wrote:

> From: David Heidelberg <david@...t.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@...t.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);
>  }
>  
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ