Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
525e9cd5 3f131813

+3 -3
+3 -3
drivers/iio/accel/bmc150-accel-core.c
··· 387 387 struct iio_mount_matrix *orientation) 388 388 { 389 389 struct iio_dev *indio_dev = dev_get_drvdata(dev); 390 - struct acpi_device *adev = ACPI_COMPANION(dev); 390 + acpi_handle handle = ACPI_HANDLE(dev); 391 391 char *name, *alt_name, *label; 392 392 393 393 if (strcmp(dev_name(dev), "i2c-BOSC0200:base") == 0) { ··· 398 398 label = "accel-display"; 399 399 } 400 400 401 - if (acpi_has_method(adev->handle, "ROTM")) { 401 + if (acpi_has_method(handle, "ROTM")) { 402 402 name = "ROTM"; 403 - } else if (acpi_has_method(adev->handle, alt_name)) { 403 + } else if (acpi_has_method(handle, alt_name)) { 404 404 name = alt_name; 405 405 indio_dev->label = label; 406 406 } else {