summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andy.shevchenko@gmail.com>2024-08-24 02:01:07 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-09-03 20:49:43 +0300
commit525e9cd5ac056e827b7a31bf48b8980d5f2e726b (patch)
tree81ee021304f927f7d65fb547b07d5b63ab217b1c
parent3f131813d70191f187f804c176a03d4f9e80ba73 (diff)
downloadlinux-525e9cd5ac056e827b7a31bf48b8980d5f2e726b.tar.xz
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 <andy.shevchenko@gmail.com> Link: https://patch.msgid.link/20240823230107.745900-1-andy.shevchenko@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/accel/bmc150-accel-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index 14ce03c70ab5..0f32c1e92b4d 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -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 {