Commit 1ef6ff6e authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: imu: inv_mpu6050: Check ACPI companion directly

Instead of checking for ACPI handle followed by extracting a companion
device, do the latter first and use it for checks.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220203155920.18586-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent c53c7740
......@@ -127,15 +127,14 @@ static int inv_mpu_process_acpi_config(struct i2c_client *client,
int inv_mpu_acpi_create_mux_client(struct i2c_client *client)
{
struct inv_mpu6050_state *st = iio_priv(dev_get_drvdata(&client->dev));
struct acpi_device *adev = ACPI_COMPANION(&client->dev);
st->mux_client = NULL;
if (ACPI_HANDLE(&client->dev)) {
if (adev) {
struct i2c_board_info info;
struct i2c_client *mux_client;
struct acpi_device *adev;
int ret = -1;
adev = ACPI_COMPANION(&client->dev);
memset(&info, 0, sizeof(info));
dmi_check_system(inv_mpu_dev_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment