* [PATCH] iio: chemical: bme680: Use dev_err_probe()
@ 2026-07-26 15:21 Vojtěch Krátký
2026-07-26 17:59 ` Siratul Islam
0 siblings, 1 reply; 2+ messages in thread
From: Vojtěch Krátký @ 2026-07-26 15:21 UTC (permalink / raw)
Cc: Vojtěch Krátký, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko,
Uwe Kleine-König (The Capable Hub), Matti Vaittinen,
Siratul Islam, Bjorn Helgaas, Takashi Sakamoto, Danilo Krummrich,
open list:IIO SUBSYSTEM AND DRIVERS, open list
Used dev_err_probe() instead of dev_err() to simplify error handling.
Signed-off-by: Vojtěch Krátký <vo.kratky@seznam.cz>
---
drivers/iio/chemical/bme680_i2c.c | 7 +++----
drivers/iio/chemical/bme680_spi.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c
index 4cc0e491621a..c34d67bcb2a3 100644
--- a/drivers/iio/chemical/bme680_i2c.c
+++ b/drivers/iio/chemical/bme680_i2c.c
@@ -24,10 +24,9 @@ static int bme680_i2c_probe(struct i2c_client *client)
const char *name = NULL;
regmap = devm_regmap_init_i2c(client, &bme680_regmap_config);
- if (IS_ERR(regmap)) {
- dev_err(&client->dev, "Failed to register i2c regmap %ld\n", PTR_ERR(regmap));
- return PTR_ERR(regmap);
- }
+ if (IS_ERR(regmap))
+ return dev_err_probe(&client->dev, PTR_ERR(regmap),
+ "Failed to register i2c regmap\n");
if (id)
name = id->name;
diff --git a/drivers/iio/chemical/bme680_spi.c b/drivers/iio/chemical/bme680_spi.c
index 785200a6fd65..e6f9b6b7f8e2 100644
--- a/drivers/iio/chemical/bme680_spi.c
+++ b/drivers/iio/chemical/bme680_spi.c
@@ -121,10 +121,9 @@ static int bme680_spi_probe(struct spi_device *spi)
regmap = devm_regmap_init(&spi->dev, &bme680_regmap_bus,
bus_context, &bme680_regmap_config);
- if (IS_ERR(regmap)) {
- dev_err(&spi->dev, "Failed to register spi regmap %ld\n", PTR_ERR(regmap));
- return PTR_ERR(regmap);
- }
+ if (IS_ERR(regmap))
+ return dev_err_probe(&spi->dev, PTR_ERR(regmap),
+ "Failed to register spi regmap\n");
return bme680_core_probe(&spi->dev, regmap, id->name);
}
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: chemical: bme680: Use dev_err_probe()
2026-07-26 15:21 [PATCH] iio: chemical: bme680: Use dev_err_probe() Vojtěch Krátký
@ 2026-07-26 17:59 ` Siratul Islam
0 siblings, 0 replies; 2+ messages in thread
From: Siratul Islam @ 2026-07-26 17:59 UTC (permalink / raw)
To: Vojtěch Krátký
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Uwe Kleine-König (The Capable Hub), Matti Vaittinen,
Siratul Islam, Bjorn Helgaas, Takashi Sakamoto, Danilo Krummrich,
open list:IIO SUBSYSTEM AND DRIVERS, open list
On Sun, 2026-07-26 at 17:21 +0200, Vojtěch Krátký wrote:
> Used dev_err_probe() instead of dev_err() to simplify error handling.
>
> Signed-off-by: Vojtěch Krátký <vo.kratky@seznam.cz>
> ---
Reviewed-by: Siratul Islam <siratul.islam@linux.dev>
--
Best regards,
Sirat
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-26 17:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-26 15:21 [PATCH] iio: chemical: bme680: Use dev_err_probe() Vojtěch Krátký
2026-07-26 17:59 ` Siratul Islam
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.