aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-08-03 18:00:44 +0200
committerHans de Goede <hdegoede@redhat.com>2021-08-12 17:26:37 +0200
commite4ec7a49ef8bb4edc85a0eee005d59fa65c94a0e (patch)
treeb87495408e297c7db7f37d494f539c8f264d0f5c /drivers/platform/x86
parentplatform/x86: i2c-multi-instantiate: Use the new i2c_acpi_client_count() helper (diff)
downloadlinux-dev-e4ec7a49ef8bb4edc85a0eee005d59fa65c94a0e.tar.xz
linux-dev-e4ec7a49ef8bb4edc85a0eee005d59fa65c94a0e.zip
platform/x86: intel_cht_int33fe: Use the new i2c_acpi_client_count() helper
Use the new i2c_acpi_client_count() helper, this results in a nice cleanup. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210803160044.158802-5-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c
index 251ed9bac789..463222521e61 100644
--- a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c
+++ b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c
@@ -16,33 +16,6 @@
#define EXPECTED_PTYPE 4
-static int cht_int33fe_i2c_res_filter(struct acpi_resource *ares, void *data)
-{
- struct acpi_resource_i2c_serialbus *sb;
- int *count = data;
-
- if (i2c_acpi_get_i2c_resource(ares, &sb))
- (*count)++;
-
- return 1;
-}
-
-static int cht_int33fe_count_i2c_clients(struct device *dev)
-{
- struct acpi_device *adev = ACPI_COMPANION(dev);
- LIST_HEAD(resource_list);
- int count = 0;
- int ret;
-
- ret = acpi_dev_get_resources(adev, &resource_list,
- cht_int33fe_i2c_res_filter, &count);
- acpi_dev_free_resource_list(&resource_list);
- if (ret < 0)
- return ret;
-
- return count;
-}
-
static int cht_int33fe_check_hw_type(struct device *dev)
{
unsigned long long ptyp;
@@ -69,7 +42,7 @@ static int cht_int33fe_check_hw_type(struct device *dev)
return -ENODEV;
}
- ret = cht_int33fe_count_i2c_clients(dev);
+ ret = i2c_acpi_client_count(ACPI_COMPANION(dev));
if (ret < 0)
return ret;