iio: accel: bmc150: Improve bmc150_apply_bosc0200_acpi_orientation()
PATCH 1/1 iio: accel: bmc150: Improve bmc150_apply_bosc0200_acpi_orientation()
By using ACPI_HANDLE() the handler argument can be retrieved directly. Replace ACPI_COMPANION() + dereference with ACPI_HANDLE().
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/iio/accel/bmc150-accel-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +3 -3
@@ -387,7 +387,7 @@ static bool bmc150_apply_bosc0200_acpi_orientation(struct device *dev, struct iio_mount_matrix *orientation) {struct iio_dev *indio_dev =dev_get_drvdata (dev); -struct acpi_device *adev =ACPI_COMPANION (dev); +acpi_handle handle =ACPI_HANDLE (dev);char *name, *alt_name, *label;if (strcmp (dev_name (dev),"i2c-BOSC0200:base" ) ==0 ) {
@@ -398,9 +398,9 @@ static bool bmc150_apply_bosc0200_acpi_orientation(struct device *dev, label ="accel-display" ; } -if (acpi_has_method (adev->handle,"ROTM" )) { +if (acpi_has_method (handle,"ROTM" )) { name ="ROTM" ; - }else if (acpi_has_method (adev->handle, alt_name)) { + }else if (acpi_has_method (handle, alt_name)) { name = alt_name; indio_dev->label = label; }else {
Signature · 1 line
2.46.0
Quoted 4 lines · On Sat, 24 Aug 2024 02:01:07 +0300 Andy Shevchenko <[email protected]>…
By using
ACPI_HANDLE()the handler argument can be retrieved directly. ReplaceACPI_COMPANION()+ dereference withACPI_HANDLE().Signed-off-by Andy Shevchenko <[email protected]>
Applied.
Thanks,
J