* [PATCH 1/7] iio: accel: msa311: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
@ 2025-08-21 8:06 ` Xichao Zhao
2025-08-21 8:06 ` [PATCH 2/7] iio: adc: " Xichao Zhao
` (6 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Xichao Zhao @ 2025-08-21 8:06 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Xichao Zhao, open list:IIO SUBSYSTEM AND DRIVERS, open list
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/iio/accel/msa311.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/accel/msa311.c b/drivers/iio/accel/msa311.c
index 3e10225410e8..32277b5822c4 100644
--- a/drivers/iio/accel/msa311.c
+++ b/drivers/iio/accel/msa311.c
@@ -990,7 +990,7 @@ static int msa311_check_partid(struct msa311_priv *msa311)
msa311->chip_name = devm_kasprintf(dev, GFP_KERNEL,
"msa311-%02x", partid);
if (!msa311->chip_name)
- return dev_err_probe(dev, -ENOMEM, "can't alloc chip name\n");
+ return -ENOMEM;
return 0;
}
@@ -1069,8 +1069,7 @@ static int msa311_setup_interrupts(struct msa311_priv *msa311)
trig = devm_iio_trigger_alloc(dev, "%s-new-data", msa311->chip_name);
if (!trig)
- return dev_err_probe(dev, -ENOMEM,
- "can't allocate newdata trigger\n");
+ return -ENOMEM;
msa311->new_data_trig = trig;
msa311->new_data_trig->ops = &msa311_new_data_trig_ops;
@@ -1153,8 +1152,7 @@ static int msa311_probe(struct i2c_client *i2c)
indio_dev = devm_iio_device_alloc(dev, sizeof(*msa311));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "IIO device allocation failed\n");
+ return -ENOMEM;
msa311 = iio_priv(indio_dev);
msa311->dev = dev;
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/7] iio: adc: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
2025-08-21 8:06 ` [PATCH 1/7] iio: accel: msa311: " Xichao Zhao
@ 2025-08-21 8:06 ` Xichao Zhao
2025-08-21 20:31 ` Martin Blumenstingl
2025-08-21 8:06 ` [PATCH 3/7] iio: chemical: " Xichao Zhao
` (5 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Xichao Zhao @ 2025-08-21 8:06 UTC (permalink / raw)
To: Andreas Klinger, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Haibo Chen, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marius Cristea,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Heiko Stuebner, Francesco Dolcini, João Paulo Gonçalves,
Hugo Villeneuve,
open list:AVIA HX711 ANALOG DIGITAL CONVERTER IIO DRIVER,
open list, open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/Amlogic Meson SoC support,
open list:ARM/Rockchip SoC support
Cc: Xichao Zhao
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/iio/adc/hx711.c | 2 +-
drivers/iio/adc/imx93_adc.c | 3 +--
drivers/iio/adc/mcp3564.c | 2 +-
drivers/iio/adc/meson_saradc.c | 2 +-
drivers/iio/adc/rockchip_saradc.c | 3 +--
drivers/iio/adc/spear_adc.c | 3 +--
drivers/iio/adc/ti-ads1119.c | 6 ++----
drivers/iio/adc/ti-ads7924.c | 3 +--
drivers/iio/adc/vf610_adc.c | 2 +-
9 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
index 7235fa9e13d5..1db8b68a8f64 100644
--- a/drivers/iio/adc/hx711.c
+++ b/drivers/iio/adc/hx711.c
@@ -465,7 +465,7 @@ static int hx711_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(struct hx711_data));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM, "failed to allocate IIO device\n");
+ return -ENOMEM;
hx711_data = iio_priv(indio_dev);
hx711_data->dev = dev;
diff --git a/drivers/iio/adc/imx93_adc.c b/drivers/iio/adc/imx93_adc.c
index 7feaafd2316f..f887cba44ec6 100644
--- a/drivers/iio/adc/imx93_adc.c
+++ b/drivers/iio/adc/imx93_adc.c
@@ -308,8 +308,7 @@ static int imx93_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(*adc));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "Failed allocating iio device\n");
+ return -ENOMEM;
adc = iio_priv(indio_dev);
adc->dev = dev;
diff --git a/drivers/iio/adc/mcp3564.c b/drivers/iio/adc/mcp3564.c
index a68f1cd6883e..cd679ff10a97 100644
--- a/drivers/iio/adc/mcp3564.c
+++ b/drivers/iio/adc/mcp3564.c
@@ -1019,7 +1019,7 @@ static int mcp3564_parse_fw_children(struct iio_dev *indio_dev)
channels = devm_kcalloc(dev, num_ch, sizeof(*channels), GFP_KERNEL);
if (!channels)
- return dev_err_probe(dev, -ENOMEM, "Can't allocate memory\n");
+ return -ENOMEM;
device_for_each_child_node_scoped(dev, child) {
node_name = fwnode_get_name(child);
diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index 4ff88603e4fc..f7e7172ef4f6 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -1357,7 +1357,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM, "failed allocating iio device\n");
+ return -ENOMEM;
priv = iio_priv(indio_dev);
init_completion(&priv->done);
diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index bd62daea0a3e..67771a70dfe4 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -466,8 +466,7 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*info));
if (!indio_dev)
- return dev_err_probe(&pdev->dev, -ENOMEM,
- "failed allocating iio device\n");
+ return -ENOMEM;
info = iio_priv(indio_dev);
diff --git a/drivers/iio/adc/spear_adc.c b/drivers/iio/adc/spear_adc.c
index e3a865c79686..418c909ff35b 100644
--- a/drivers/iio/adc/spear_adc.c
+++ b/drivers/iio/adc/spear_adc.c
@@ -274,8 +274,7 @@ static int spear_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(struct spear_adc_state));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "failed allocating iio device\n");
+ return -ENOMEM;
st = iio_priv(indio_dev);
st->dev = dev;
diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c
index d2f86e1ec656..0e0628084b5d 100644
--- a/drivers/iio/adc/ti-ads1119.c
+++ b/drivers/iio/adc/ti-ads1119.c
@@ -693,8 +693,7 @@ static int ads1119_probe(struct i2c_client *client)
indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "Failed to allocate IIO device\n");
+ return -ENOMEM;
st = iio_priv(indio_dev);
st->client = client;
@@ -750,8 +749,7 @@ static int ads1119_probe(struct i2c_client *client)
indio_dev->name,
iio_device_id(indio_dev));
if (!st->trig)
- return dev_err_probe(dev, -ENOMEM,
- "Failed to allocate IIO trigger\n");
+ return -ENOMEM;
st->trig->ops = &ads1119_trigger_ops;
iio_trigger_set_drvdata(st->trig, indio_dev);
diff --git a/drivers/iio/adc/ti-ads7924.c b/drivers/iio/adc/ti-ads7924.c
index b1f745f75dbe..30285765c299 100644
--- a/drivers/iio/adc/ti-ads7924.c
+++ b/drivers/iio/adc/ti-ads7924.c
@@ -355,8 +355,7 @@ static int ads7924_probe(struct i2c_client *client)
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "failed to allocate iio device\n");
+ return -ENOMEM;
data = iio_priv(indio_dev);
diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index 1b3b1843a801..d7182ed0d2a7 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -832,7 +832,7 @@ static int vf610_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct vf610_adc));
if (!indio_dev)
- return dev_err_probe(&pdev->dev, -ENOMEM, "Failed allocating iio device\n");
+ return -ENOMEM;
info = iio_priv(indio_dev);
info->dev = &pdev->dev;
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 2/7] iio: adc: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 ` [PATCH 2/7] iio: adc: " Xichao Zhao
@ 2025-08-21 20:31 ` Martin Blumenstingl
2025-08-25 8:36 ` Jonathan Cameron
0 siblings, 1 reply; 19+ messages in thread
From: Martin Blumenstingl @ 2025-08-21 20:31 UTC (permalink / raw)
To: Xichao Zhao
Cc: Andreas Klinger, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Haibo Chen, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marius Cristea,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Heiko Stuebner,
Francesco Dolcini, João Paulo Gonçalves,
Hugo Villeneuve,
open list:AVIA HX711 ANALOG DIGITAL CONVERTER IIO DRIVER,
open list, open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/Amlogic Meson SoC support,
open list:ARM/Rockchip SoC support
On Thu, Aug 21, 2025 at 10:07 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
> drivers/iio/adc/hx711.c | 2 +-
> drivers/iio/adc/imx93_adc.c | 3 +--
> drivers/iio/adc/mcp3564.c | 2 +-
> drivers/iio/adc/meson_saradc.c | 2 +-
For meson_saradc:
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/7] iio: adc: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 20:31 ` Martin Blumenstingl
@ 2025-08-25 8:36 ` Jonathan Cameron
0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2025-08-25 8:36 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: Xichao Zhao, Andreas Klinger, David Lechner, Nuno Sá,
Andy Shevchenko, Haibo Chen, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marius Cristea,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Heiko Stuebner,
Francesco Dolcini, João Paulo Gonçalves,
Hugo Villeneuve,
open list:AVIA HX711 ANALOG DIGITAL CONVERTER IIO DRIVER,
open list, open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/Amlogic Meson SoC support,
open list:ARM/Rockchip SoC support
On Thu, 21 Aug 2025 22:31:51 +0200
Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:
> On Thu, Aug 21, 2025 at 10:07 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
> >
> > The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> > Therefore, remove the useless call to dev_err_probe(), and just
> > return the value instead.
> >
> > Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> > ---
> > drivers/iio/adc/hx711.c | 2 +-
> > drivers/iio/adc/imx93_adc.c | 3 +--
> > drivers/iio/adc/mcp3564.c | 2 +-
> > drivers/iio/adc/meson_saradc.c | 2 +-
> For meson_saradc:
> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>
Hi Martin (applies to others in this series),
For a comment about a tag please use the style submitting-patches suggests.
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> # for meson_saradc
Then the tooling picks it automatically. Sometimes I remember to edit commits
to tidy this up, but not always!
Jonathan
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 3/7] iio: chemical: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
2025-08-21 8:06 ` [PATCH 1/7] iio: accel: msa311: " Xichao Zhao
2025-08-21 8:06 ` [PATCH 2/7] iio: adc: " Xichao Zhao
@ 2025-08-21 8:06 ` Xichao Zhao
2025-08-23 17:27 ` Gustavo Silva
2025-08-21 8:06 ` [PATCH 4/7] iio: imu: bmi323: " Xichao Zhao
` (4 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Xichao Zhao @ 2025-08-21 8:06 UTC (permalink / raw)
To: Gustavo Silva, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Tomasz Duszynski,
open list:IIO SUBSYSTEM AND DRIVERS, open list
Cc: Xichao Zhao
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/iio/chemical/ens160_core.c | 3 +--
drivers/iio/chemical/scd30_core.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/chemical/ens160_core.c b/drivers/iio/chemical/ens160_core.c
index 6cec60074827..86bde4a91bf7 100644
--- a/drivers/iio/chemical/ens160_core.c
+++ b/drivers/iio/chemical/ens160_core.c
@@ -305,8 +305,7 @@ static int ens160_setup_trigger(struct iio_dev *indio_dev, int irq)
trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name,
iio_device_id(indio_dev));
if (!trig)
- return dev_err_probe(dev, -ENOMEM,
- "failed to allocate trigger\n");
+ return -ENOMEM;
trig->ops = &ens160_trigger_ops;
iio_trigger_set_drvdata(trig, indio_dev);
diff --git a/drivers/iio/chemical/scd30_core.c b/drivers/iio/chemical/scd30_core.c
index 5df1926cd5d9..a665fcb78806 100644
--- a/drivers/iio/chemical/scd30_core.c
+++ b/drivers/iio/chemical/scd30_core.c
@@ -635,7 +635,7 @@ static int scd30_setup_trigger(struct iio_dev *indio_dev)
trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name,
iio_device_id(indio_dev));
if (!trig)
- return dev_err_probe(dev, -ENOMEM, "failed to allocate trigger\n");
+ return -ENOMEM;
trig->ops = &scd30_trigger_ops;
iio_trigger_set_drvdata(trig, indio_dev);
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 3/7] iio: chemical: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 ` [PATCH 3/7] iio: chemical: " Xichao Zhao
@ 2025-08-23 17:27 ` Gustavo Silva
2025-08-25 8:37 ` Jonathan Cameron
0 siblings, 1 reply; 19+ messages in thread
From: Gustavo Silva @ 2025-08-23 17:27 UTC (permalink / raw)
To: Xichao Zhao
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Tomasz Duszynski, open list:IIO SUBSYSTEM AND DRIVERS, open list
On Thu, Aug 21, 2025 at 04:06:47PM +0800, Xichao Zhao wrote:
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
> drivers/iio/chemical/ens160_core.c | 3 +--
> drivers/iio/chemical/scd30_core.c | 2 +-
> 2 files changed, 2 insertions(+), 3 deletions(-)
For ens160:
Reviewed-by: Gustavo Silva <gustavograzs@gmail.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 3/7] iio: chemical: Remove dev_err_probe() if error is -ENOMEM
2025-08-23 17:27 ` Gustavo Silva
@ 2025-08-25 8:37 ` Jonathan Cameron
0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2025-08-25 8:37 UTC (permalink / raw)
To: Gustavo Silva
Cc: Xichao Zhao, David Lechner, Nuno Sá, Andy Shevchenko,
Tomasz Duszynski, open list:IIO SUBSYSTEM AND DRIVERS, open list
On Sat, 23 Aug 2025 14:27:55 -0300
Gustavo Silva <gustavograzs@gmail.com> wrote:
> On Thu, Aug 21, 2025 at 04:06:47PM +0800, Xichao Zhao wrote:
> > The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> > Therefore, remove the useless call to dev_err_probe(), and just
> > return the value instead.
> >
> > Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> > ---
> > drivers/iio/chemical/ens160_core.c | 3 +--
> > drivers/iio/chemical/scd30_core.c | 2 +-
> > 2 files changed, 2 insertions(+), 3 deletions(-)
> For ens160:
> Reviewed-by: Gustavo Silva <gustavograzs@gmail.com>
Please use
Reviewed-by: Gustavo Silva <gustavograzs@gmail.com> # for ens160
for commented tags. Then tooling should pick them up correctly
without me needing to hand edit.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/7] iio: imu: bmi323: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
` (2 preceding siblings ...)
2025-08-21 8:06 ` [PATCH 3/7] iio: chemical: " Xichao Zhao
@ 2025-08-21 8:06 ` Xichao Zhao
2025-08-21 8:06 ` [PATCH 5/7] iio: light: " Xichao Zhao
` (3 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Xichao Zhao @ 2025-08-21 8:06 UTC (permalink / raw)
To: Jagath Jog J, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, open list:BOSCH SENSORTEC BMI323 IMU IIO DRIVER,
open list
Cc: Xichao Zhao
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/iio/imu/bmi323/bmi323_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c
index fc54d464a3ae..6bcb9a436581 100644
--- a/drivers/iio/imu/bmi323/bmi323_core.c
+++ b/drivers/iio/imu/bmi323/bmi323_core.c
@@ -2112,8 +2112,7 @@ int bmi323_core_probe(struct device *dev)
indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "Failed to allocate device\n");
+ return -ENOMEM;
ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(regulator_names),
regulator_names);
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 5/7] iio: light: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
` (3 preceding siblings ...)
2025-08-21 8:06 ` [PATCH 4/7] iio: imu: bmi323: " Xichao Zhao
@ 2025-08-21 8:06 ` Xichao Zhao
2025-08-21 8:06 ` [PATCH 6/7] iio: proximity: " Xichao Zhao
` (2 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Xichao Zhao @ 2025-08-21 8:06 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Per-Daniel Olsson, open list:IIO SUBSYSTEM AND DRIVERS, open list
Cc: Xichao Zhao
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/iio/light/opt4060.c | 2 +-
drivers/iio/light/veml6040.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/opt4060.c b/drivers/iio/light/opt4060.c
index 566f1bb8fe2a..e96687700c91 100644
--- a/drivers/iio/light/opt4060.c
+++ b/drivers/iio/light/opt4060.c
@@ -1212,7 +1212,7 @@ static int opt4060_setup_trigger(struct opt4060_chip *chip, struct iio_dev *idev
name = devm_kasprintf(chip->dev, GFP_KERNEL, "%s-opt4060",
dev_name(chip->dev));
if (!name)
- return dev_err_probe(chip->dev, -ENOMEM, "Failed to alloc chip name\n");
+ return -ENOMEM;
ret = devm_request_threaded_irq(chip->dev, chip->irq, NULL, opt4060_irq_thread,
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
diff --git a/drivers/iio/light/veml6040.c b/drivers/iio/light/veml6040.c
index 71a594b2ec85..f563f9f0ee67 100644
--- a/drivers/iio/light/veml6040.c
+++ b/drivers/iio/light/veml6040.c
@@ -219,8 +219,7 @@ static int veml6040_probe(struct i2c_client *client)
indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "IIO device allocation failed\n");
+ return -ENOMEM;
regmap = devm_regmap_init_i2c(client, &veml6040_regmap_config);
if (IS_ERR(regmap))
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 6/7] iio: proximity: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
` (4 preceding siblings ...)
2025-08-21 8:06 ` [PATCH 5/7] iio: light: " Xichao Zhao
@ 2025-08-21 8:06 ` Xichao Zhao
2025-08-21 8:06 ` [PATCH 7/7] iio: temperature: mlx90635: " Xichao Zhao
2025-08-21 8:13 ` [PATCH 0/7] iio: " Andy Shevchenko
7 siblings, 0 replies; 19+ messages in thread
From: Xichao Zhao @ 2025-08-21 8:06 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Waqar Hameed, Yasin Lee, Julien Stephan, Xichao Zhao,
open list:IIO SUBSYSTEM AND DRIVERS, open list
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/iio/proximity/d3323aa.c | 3 +--
drivers/iio/proximity/hx9023s.c | 3 +--
drivers/iio/proximity/irsd200.c | 6 ++----
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/proximity/d3323aa.c b/drivers/iio/proximity/d3323aa.c
index d4c3dbea9bb0..30821f583454 100644
--- a/drivers/iio/proximity/d3323aa.c
+++ b/drivers/iio/proximity/d3323aa.c
@@ -722,8 +722,7 @@ static int d3323aa_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
if (!indio_dev)
- return dev_err_probe(dev, -ENOMEM,
- "Could not allocate iio device\n");
+ return -ENOMEM;
data = iio_priv(indio_dev);
data->dev = dev;
diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c
index 33781c314728..2918dfc0df54 100644
--- a/drivers/iio/proximity/hx9023s.c
+++ b/drivers/iio/proximity/hx9023s.c
@@ -1141,8 +1141,7 @@ static int hx9023s_probe(struct i2c_client *client)
indio_dev->name,
iio_device_id(indio_dev));
if (!data->trig)
- return dev_err_probe(dev, -ENOMEM,
- "iio trigger alloc failed\n");
+ return -ENOMEM;
data->trig->ops = &hx9023s_trigger_ops;
iio_trigger_set_drvdata(data->trig, indio_dev);
diff --git a/drivers/iio/proximity/irsd200.c b/drivers/iio/proximity/irsd200.c
index 253e4aef22fb..65af31d43453 100644
--- a/drivers/iio/proximity/irsd200.c
+++ b/drivers/iio/proximity/irsd200.c
@@ -862,8 +862,7 @@ static int irsd200_probe(struct i2c_client *client)
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev)
- return dev_err_probe(&client->dev, -ENOMEM,
- "Could not allocate iio device\n");
+ return -ENOMEM;
data = iio_priv(indio_dev);
data->dev = &client->dev;
@@ -916,8 +915,7 @@ static int irsd200_probe(struct i2c_client *client)
trigger = devm_iio_trigger_alloc(data->dev, "%s-dev%d", indio_dev->name,
iio_device_id(indio_dev));
if (!trigger)
- return dev_err_probe(data->dev, -ENOMEM,
- "Could not allocate iio trigger\n");
+ return -ENOMEM;
trigger->ops = &irsd200_trigger_ops;
iio_trigger_set_drvdata(trigger, data);
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 7/7] iio: temperature: mlx90635: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
` (5 preceding siblings ...)
2025-08-21 8:06 ` [PATCH 6/7] iio: proximity: " Xichao Zhao
@ 2025-08-21 8:06 ` Xichao Zhao
2025-08-21 11:46 ` Crt Mori
2025-08-21 8:13 ` [PATCH 0/7] iio: " Andy Shevchenko
7 siblings, 1 reply; 19+ messages in thread
From: Xichao Zhao @ 2025-08-21 8:06 UTC (permalink / raw)
To: Crt Mori, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, open list:MELEXIS MLX90635 DRIVER, open list
Cc: Xichao Zhao
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/iio/temperature/mlx90635.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
index f7f88498ba0e..6d386d887855 100644
--- a/drivers/iio/temperature/mlx90635.c
+++ b/drivers/iio/temperature/mlx90635.c
@@ -939,7 +939,7 @@ static int mlx90635_probe(struct i2c_client *client)
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*mlx90635));
if (!indio_dev)
- return dev_err_probe(&client->dev, -ENOMEM, "failed to allocate device\n");
+ return -ENOMEM;
regmap = devm_regmap_init_i2c(client, &mlx90635_regmap);
if (IS_ERR(regmap))
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 7/7] iio: temperature: mlx90635: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 ` [PATCH 7/7] iio: temperature: mlx90635: " Xichao Zhao
@ 2025-08-21 11:46 ` Crt Mori
2025-08-21 12:46 ` Andy Shevchenko
0 siblings, 1 reply; 19+ messages in thread
From: Crt Mori @ 2025-08-21 11:46 UTC (permalink / raw)
To: Xichao Zhao
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
open list:MELEXIS MLX90635 DRIVER, open list
I am not sure I agree with this. It provides an error message with
reason and I understand we want as few as possible, but this would be
a valid remark inside the logs?
On Thu, 21 Aug 2025 at 10:08, Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
> drivers/iio/temperature/mlx90635.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
> index f7f88498ba0e..6d386d887855 100644
> --- a/drivers/iio/temperature/mlx90635.c
> +++ b/drivers/iio/temperature/mlx90635.c
> @@ -939,7 +939,7 @@ static int mlx90635_probe(struct i2c_client *client)
>
> indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*mlx90635));
> if (!indio_dev)
> - return dev_err_probe(&client->dev, -ENOMEM, "failed to allocate device\n");
> + return -ENOMEM;
>
> regmap = devm_regmap_init_i2c(client, &mlx90635_regmap);
> if (IS_ERR(regmap))
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 7/7] iio: temperature: mlx90635: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 11:46 ` Crt Mori
@ 2025-08-21 12:46 ` Andy Shevchenko
2025-08-21 14:00 ` Crt Mori
0 siblings, 1 reply; 19+ messages in thread
From: Andy Shevchenko @ 2025-08-21 12:46 UTC (permalink / raw)
To: Crt Mori
Cc: Xichao Zhao, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, open list:MELEXIS MLX90635 DRIVER, open list
On Thu, Aug 21, 2025 at 2:47 PM Crt Mori <cmo@melexis.com> wrote:
>
> I am not sure I agree with this. It provides an error message with
> reason and I understand we want as few as possible, but this would be
> a valid remark inside the logs?
How? dev_err_probe() is no-op for ENOMEM.
Also there is an agreement inside the kernel community that ENOMEM
errors need no log, as if it's the case, we have much bigger issues
than that.
> On Thu, 21 Aug 2025 at 10:08, Xichao Zhao <zhao.xichao@vivo.com> wrote:
> >
> > The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> > Therefore, remove the useless call to dev_err_probe(), and just
> > return the value instead.
With all that said, the series is correct and good to go. I don't see
obstacles otherwise.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 7/7] iio: temperature: mlx90635: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 12:46 ` Andy Shevchenko
@ 2025-08-21 14:00 ` Crt Mori
0 siblings, 0 replies; 19+ messages in thread
From: Crt Mori @ 2025-08-21 14:00 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Xichao Zhao, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, open list:MELEXIS MLX90635 DRIVER, open list
Ok, fair enough. (sorry was html message before)
Acked-by: Crt Mori<cmo@melexis.com>
On Thu, 21 Aug 2025 at 14:47, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>
> On Thu, Aug 21, 2025 at 2:47 PM Crt Mori <cmo@melexis.com> wrote:
> >
> > I am not sure I agree with this. It provides an error message with
> > reason and I understand we want as few as possible, but this would be
> > a valid remark inside the logs?
>
> How? dev_err_probe() is no-op for ENOMEM.
>
> Also there is an agreement inside the kernel community that ENOMEM
> errors need no log, as if it's the case, we have much bigger issues
> than that.
>
> > On Thu, 21 Aug 2025 at 10:08, Xichao Zhao <zhao.xichao@vivo.com> wrote:
> > >
> > > The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> > > Therefore, remove the useless call to dev_err_probe(), and just
> > > return the value instead.
>
> With all that said, the series is correct and good to go. I don't see
> obstacles otherwise.
>
> --
> With Best Regards,
> Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:06 [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
` (6 preceding siblings ...)
2025-08-21 8:06 ` [PATCH 7/7] iio: temperature: mlx90635: " Xichao Zhao
@ 2025-08-21 8:13 ` Andy Shevchenko
2025-08-21 11:50 ` Crt Mori
2025-08-25 8:41 ` Jonathan Cameron
7 siblings, 2 replies; 19+ messages in thread
From: Andy Shevchenko @ 2025-08-21 8:13 UTC (permalink / raw)
To: Xichao Zhao
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andreas Klinger, Haibo Chen, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marius Cristea,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Heiko Stuebner, Francesco Dolcini, João Paulo Gonçalves,
Hugo Villeneuve, Gustavo Silva, Tomasz Duszynski, Jagath Jog J,
Crt Mori, Per-Daniel Olsson, Waqar Hameed, Yasin Lee,
Julien Stephan, open list:IIO SUBSYSTEM AND DRIVERS, open list,
open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/Amlogic Meson SoC support,
open list:ARM/Rockchip SoC support
On Thu, Aug 21, 2025 at 11:07 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
when the error
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
In favour of this series,
Reviewed-by: Andy Shevchenko <andy@kernel.org>
(yes, I indeed looked at all patches in this one :-)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:13 ` [PATCH 0/7] iio: " Andy Shevchenko
@ 2025-08-21 11:50 ` Crt Mori
2025-08-21 12:47 ` Andy Shevchenko
2025-08-25 8:41 ` Jonathan Cameron
1 sibling, 1 reply; 19+ messages in thread
From: Crt Mori @ 2025-08-21 11:50 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Xichao Zhao, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Andreas Klinger, Haibo Chen, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Marius Cristea, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Heiko Stuebner, Francesco Dolcini,
João Paulo Gonçalves, Hugo Villeneuve, Gustavo Silva,
Tomasz Duszynski, Jagath Jog J, Per-Daniel Olsson, Waqar Hameed,
Yasin Lee, Julien Stephan, open list:IIO SUBSYSTEM AND DRIVERS,
open list, open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/Amlogic Meson SoC support,
open list:ARM/Rockchip SoC support
Sorry duplicate - as I commented on driver.
On Thu, 21 Aug 2025 at 10:13, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>
> On Thu, Aug 21, 2025 at 11:07 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
> >
> > The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
>
> when the error
>
> > Therefore, remove the useless call to dev_err_probe(), and just
> > return the value instead.
>
> In favour of this series,
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> (yes, I indeed looked at all patches in this one :-)
>
I am not sure I agree with this. It provides an error message with
reason and I understand we want as few as possible, but this would be
a valid remark inside the logs, but without it we only get error value
to figure out where it comes from?
> --
> With Best Regards,
> Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 11:50 ` Crt Mori
@ 2025-08-21 12:47 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2025-08-21 12:47 UTC (permalink / raw)
To: Crt Mori
Cc: Xichao Zhao, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Andreas Klinger, Haibo Chen, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Marius Cristea, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Heiko Stuebner, Francesco Dolcini,
João Paulo Gonçalves, Hugo Villeneuve, Gustavo Silva,
Tomasz Duszynski, Jagath Jog J, Per-Daniel Olsson, Waqar Hameed,
Yasin Lee, Julien Stephan, open list:IIO SUBSYSTEM AND DRIVERS,
open list, open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/Amlogic Meson SoC support,
open list:ARM/Rockchip SoC support
On Thu, Aug 21, 2025 at 2:50 PM Crt Mori <cmo@melexis.com> wrote:
>
> Sorry duplicate - as I commented on driver.
Yep, answered there.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/7] iio: Remove dev_err_probe() if error is -ENOMEM
2025-08-21 8:13 ` [PATCH 0/7] iio: " Andy Shevchenko
2025-08-21 11:50 ` Crt Mori
@ 2025-08-25 8:41 ` Jonathan Cameron
1 sibling, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2025-08-25 8:41 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Xichao Zhao, David Lechner, Nuno Sá, Andy Shevchenko,
Andreas Klinger, Haibo Chen, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marius Cristea,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Heiko Stuebner, Francesco Dolcini, João Paulo Gonçalves,
Hugo Villeneuve, Gustavo Silva, Tomasz Duszynski, Jagath Jog J,
Crt Mori, Per-Daniel Olsson, Waqar Hameed, Yasin Lee,
Julien Stephan, open list:IIO SUBSYSTEM AND DRIVERS, open list,
open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/Amlogic Meson SoC support,
open list:ARM/Rockchip SoC support
On Thu, 21 Aug 2025 11:13:00 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Thu, Aug 21, 2025 at 11:07 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
> >
> > The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
>
> when the error
>
Tweaked and applied.
> > Therefore, remove the useless call to dev_err_probe(), and just
> > return the value instead.
>
> In favour of this series,
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> (yes, I indeed looked at all patches in this one :-)
>
^ permalink raw reply [flat|nested] 19+ messages in thread