From eddebe6dbe2c961ee7f6dc4a1fafc81212b44177 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 3 Aug 2021 19:32:52 +0300 Subject: platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ACPI provides a generic helper to get I²C Serial Bus resources. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20210803163252.60141-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede --- drivers/platform/surface/surface3_power.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/platform/surface') 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; } -- cgit v1.2.3