Skip to content

Commit 525e9cd

Browse files
andy-shevjic23
authored andcommitted
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]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 3f13181 commit 525e9cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iio/accel/bmc150-accel-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static bool bmc150_apply_bosc0200_acpi_orientation(struct device *dev,
387387
struct iio_mount_matrix *orientation)
388388
{
389389
struct iio_dev *indio_dev = dev_get_drvdata(dev);
390-
struct acpi_device *adev = ACPI_COMPANION(dev);
390+
acpi_handle handle = ACPI_HANDLE(dev);
391391
char *name, *alt_name, *label;
392392

393393
if (strcmp(dev_name(dev), "i2c-BOSC0200:base") == 0) {
@@ -398,9 +398,9 @@ static bool bmc150_apply_bosc0200_acpi_orientation(struct device *dev,
398398
label = "accel-display";
399399
}
400400

401-
if (acpi_has_method(adev->handle, "ROTM")) {
401+
if (acpi_has_method(handle, "ROTM")) {
402402
name = "ROTM";
403-
} else if (acpi_has_method(adev->handle, alt_name)) {
403+
} else if (acpi_has_method(handle, alt_name)) {
404404
name = alt_name;
405405
indio_dev->label = label;
406406
} else {

0 commit comments

Comments
 (0)