On Fri, 22 Aug 2025 09:19:52 +0530
Dixit Parmar <dixitparmar19@gmail.com> wrote:
> The drivers do not require their own error messages for error
> -ENOMEM, memory allocation failures. So remove the dev_err
> messages from the probe().
>
> Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com>
Some code movement in here so I had applied the equivalent.
J
> ---
> drivers/iio/health/afe4403.c | 4 +---
> drivers/iio/health/afe4404.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c
> index 1582cfc03579..8e5db2235de0 100644
> --- a/drivers/iio/health/afe4403.c
> +++ b/drivers/iio/health/afe4403.c
> @@ -531,10 +531,8 @@ static int afe4403_probe(struct spi_device *spi)
> "%s-dev%d",
> indio_dev->name,
> iio_device_id(indio_dev));
> - if (!afe->trig) {
> - dev_err(afe->dev, "Unable to allocate IIO trigger\n");
> + if (!afe->trig)
> return -ENOMEM;
> - }
>
> iio_trigger_set_drvdata(afe->trig, indio_dev);
>
> diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c
> index 99ff68aed27c..11a0f465fd68 100644
> --- a/drivers/iio/health/afe4404.c
> +++ b/drivers/iio/health/afe4404.c
> @@ -538,10 +538,8 @@ static int afe4404_probe(struct i2c_client *client)
> "%s-dev%d",
> indio_dev->name,
> iio_device_id(indio_dev));
> - if (!afe->trig) {
> - dev_err(afe->dev, "Unable to allocate IIO trigger\n");
> + if (!afe->trig)
> return -ENOMEM;
> - }
>
> iio_trigger_set_drvdata(afe->trig, indio_dev);
>
>