Commit eddebe6d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Hans de Goede

platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper

ACPI provides a generic helper to get I²C Serial Bus resources.
Use it instead of open coded variant.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210803163252.60141-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 560c71d4
...@@ -384,13 +384,7 @@ mshw0011_space_handler(u32 function, acpi_physical_address command, ...@@ -384,13 +384,7 @@ mshw0011_space_handler(u32 function, acpi_physical_address command,
if (ACPI_FAILURE(ret)) if (ACPI_FAILURE(ret))
return ret; return ret;
if (!value64 || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) { if (!value64 || !i2c_acpi_get_i2c_resource(ares, &sb)) {
ret = AE_BAD_PARAMETER;
goto err;
}
sb = &ares->data.i2c_serial_bus;
if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C) {
ret = AE_BAD_PARAMETER; ret = AE_BAD_PARAMETER;
goto err; goto err;
} }
......
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