summaryrefslogtreecommitdiffstats
path: root/drivers/platform/surface
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-08-03 19:32:52 +0300
committerHans de Goede <hdegoede@redhat.com>2021-08-12 09:26:28 +0200
commiteddebe6dbe2c961ee7f6dc4a1fafc81212b44177 (patch)
treed6c06134cf5af690c4e5b01d2fc6f79ff5ac63fb /drivers/platform/surface
parent560c71d4250f5f32b7952c290ddaf3cd4548a3ec (diff)
downloadlinux-eddebe6dbe2c961ee7f6dc4a1fafc81212b44177.tar.bz2
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210803163252.60141-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/surface')
-rw-r--r--drivers/platform/surface/surface3_power.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c
index dea82aa1abd4..90c1568ea4e0 100644
--- a/drivers/platform/surface/surface3_power.c
+++ b/drivers/platform/surface/surface3_power.c
@@ -384,13 +384,7 @@ mshw0011_space_handler(u32 function, acpi_physical_address command,
if (ACPI_FAILURE(ret))
return ret;
- if (!value64 || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) {
- ret = AE_BAD_PARAMETER;
- goto err;
- }
-
- sb = &ares->data.i2c_serial_bus;
- if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C) {
+ if (!value64 || !i2c_acpi_get_i2c_resource(ares, &sb)) {
ret = AE_BAD_PARAMETER;
goto err;
}