From: Denis Benato Date: Thu, 23 May 2024 17:47:36 +0000 (+0200) Subject: iio: imu: bmi323: Use iio read_acpi_mount_matrix() helper X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5c3266385e4f27c69c03bcbfa68339b49be91c56;p=users%2Fjedix%2Flinux-maple.git iio: imu: bmi323: Use iio read_acpi_mount_matrix() helper bmi150-accel and bmi323-imu are declared in an almost identical way in the ACPI and in some devices such as the Asus RC71L the "ROTM" property can be found: parse and use the ACPI-defined mount-matrix. Co-developed-by: Luke D. Jones Co-developed-by: Jonathan LoBue Signed-off-by: Denis Benato Link: https://lore.kernel.org/r/20240523174736.16692-2-benato.denis96@gmail.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c index 5d42ab9b176a3..b391e5e701b1c 100644 --- a/drivers/iio/imu/bmi323/bmi323_core.c +++ b/drivers/iio/imu/bmi323/bmi323_core.c @@ -2083,9 +2083,11 @@ int bmi323_core_probe(struct device *dev) if (ret) return -EINVAL; - ret = iio_read_mount_matrix(dev, &data->orientation); - if (ret) - return ret; + if (!iio_read_acpi_mount_matrix(dev, &data->orientation, "ROTM")) { + ret = iio_read_mount_matrix(dev, &data->orientation); + if (ret) + return ret; + } indio_dev->name = "bmi323-imu"; indio_dev->info = &bmi323_info;