[PATCH] iio: imu: bmi270: fix dev_err_probe error msg

Rodrigo Gobbi posted 1 patch 2 months, 1 week ago
There is a newer version of this series
drivers/iio/imu/bmi270/bmi270_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] iio: imu: bmi270: fix dev_err_probe error msg
Posted by Rodrigo Gobbi 2 months, 1 week ago
The bmi270 can be connected to I2C or a SPI interface. If it is a SPI,
during probe, if devm_regmap_init() fails, it should print the "spi"
term rather "i2c".

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
---
Just fixing this little "typo", definitely it was copied from the bmi270_i2c.c [1],
which has the same dev_err_probe logic.
Tks and regards.

[1] https://github.com/torvalds/linux/blob/master/drivers/iio/imu/bmi270/bmi270_i2c.c#L30
---
 drivers/iio/imu/bmi270/bmi270_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/bmi270/bmi270_spi.c b/drivers/iio/imu/bmi270/bmi270_spi.c
index 19dd7734f9d0..5e625586681d 100644
--- a/drivers/iio/imu/bmi270/bmi270_spi.c
+++ b/drivers/iio/imu/bmi270/bmi270_spi.c
@@ -60,7 +60,7 @@ static int bmi270_spi_probe(struct spi_device *spi)
 				  &bmi270_spi_regmap_config);
 	if (IS_ERR(regmap))
 		return dev_err_probe(dev, PTR_ERR(regmap),
-				     "Failed to init i2c regmap");
+				     "Failed to init spi regmap");
 
 	return bmi270_core_probe(dev, regmap, chip_info);
 }
-- 
2.48.1
Re: [PATCH] iio: imu: bmi270: fix dev_err_probe error msg
Posted by Jonathan Cameron 2 months, 1 week ago
On Fri, 10 Oct 2025 16:06:46 -0300
Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com> wrote:

> The bmi270 can be connected to I2C or a SPI interface. If it is a SPI,
> during probe, if devm_regmap_init() fails, it should print the "spi"
> term rather "i2c".
> 
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
> ---
> Just fixing this little "typo", definitely it was copied from the bmi270_i2c.c [1],
> which has the same dev_err_probe logic.
> Tks and regards.
> 
> [1] https://github.com/torvalds/linux/blob/master/drivers/iio/imu/bmi270/bmi270_i2c.c#L30

Given the confusion this could cause I'm thinking this should go to stable.
It needs a fixes tag.

thanks,

Jonathan

> ---
>  drivers/iio/imu/bmi270/bmi270_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/imu/bmi270/bmi270_spi.c b/drivers/iio/imu/bmi270/bmi270_spi.c
> index 19dd7734f9d0..5e625586681d 100644
> --- a/drivers/iio/imu/bmi270/bmi270_spi.c
> +++ b/drivers/iio/imu/bmi270/bmi270_spi.c
> @@ -60,7 +60,7 @@ static int bmi270_spi_probe(struct spi_device *spi)
>  				  &bmi270_spi_regmap_config);
>  	if (IS_ERR(regmap))
>  		return dev_err_probe(dev, PTR_ERR(regmap),
> -				     "Failed to init i2c regmap");
> +				     "Failed to init spi regmap");
>  
>  	return bmi270_core_probe(dev, regmap, chip_info);
>  }