diff mbox series

iio: imu: lsm6dsx: Fix mount matrix retrieval

Message ID 12960181.O9o76ZdvQC@alexpc (mailing list archive)
State Superseded
Headers show
Series iio: imu: lsm6dsx: Fix mount matrix retrieval | expand

Commit Message

Alejandro Tafalla July 12, 2023, 10:32 a.m. UTC
The function lsm6dsx_get_acpi_mount_matrix should return true when ACPI
support is not enabled to allow executing iio_read_mount_matrix in the
probe function.

Fixes: dc3d25f22b88 ("iio: imu: lsm6dsx: Add ACPI mount matrix retrieval")

Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 
 #endif

Comments

Lorenzo Bianconi July 12, 2023, 11:04 a.m. UTC | #1
> The function lsm6dsx_get_acpi_mount_matrix should return true when ACPI
> support is not enabled to allow executing iio_read_mount_matrix in the
> probe function.
> 
> Fixes: dc3d25f22b88 ("iio: imu: lsm6dsx: Add ACPI mount matrix retrieval")
> 
> Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/
> st_lsm6dsx/st_lsm6dsx_core.c
> index 6a18b363cf73..62bc3ee783fb 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -2687,7 +2687,7 @@ static int lsm6dsx_get_acpi_mount_matrix(struct device 
> *dev,
>  static int lsm6dsx_get_acpi_mount_matrix(struct device *dev,
>  					  struct 
> iio_mount_matrix *orientation)
>  {
> -	return false;
> +	return true;

I would say it should return something like -EOPNOTSUPP.

Regards,
Lorenzo

>  }
>  
>  #endif
> -- 
> 2.41.0
> 
> 
> 
>
Alejandro Tafalla July 12, 2023, 6:24 p.m. UTC | #2
On miƩrcoles, 12 de julio de 2023 13:04:05 (CEST) Lorenzo Bianconi wrote:
> > The function lsm6dsx_get_acpi_mount_matrix should return true when ACPI
> > support is not enabled to allow executing iio_read_mount_matrix in the
> > probe function.
> > 
> > Fixes: dc3d25f22b88 ("iio: imu: lsm6dsx: Add ACPI mount matrix retrieval")
> > 
> > Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
> > ---
> > 
> >  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > b/drivers/iio/imu/ st_lsm6dsx/st_lsm6dsx_core.c
> > index 6a18b363cf73..62bc3ee783fb 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > @@ -2687,7 +2687,7 @@ static int lsm6dsx_get_acpi_mount_matrix(struct
> > device *dev,
> > 
> >  static int lsm6dsx_get_acpi_mount_matrix(struct device *dev,
> >  
> >  					  struct
> > 
> > iio_mount_matrix *orientation)
> > 
> >  {
> > 
> > -	return false;
> > +	return true;
> 
> I would say it should return something like -EOPNOTSUPP.
> 
> Regards,
> Lorenzo
> 
> >  }
> >  
> >  #endif

Hi, thank you for the review. I'll send a v2 with a better solution that uses 
error codes.

Alejandro.
diff mbox series

Patch

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/
st_lsm6dsx/st_lsm6dsx_core.c
index 6a18b363cf73..62bc3ee783fb 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -2687,7 +2687,7 @@  static int lsm6dsx_get_acpi_mount_matrix(struct device 
*dev,
 static int lsm6dsx_get_acpi_mount_matrix(struct device *dev,
 					  struct 
iio_mount_matrix *orientation)
 {
-	return false;
+	return true;
 }