Merge tag 'leds-for-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anasz...
[sfrench/cifs-2.6.git] / drivers / i2c / i2c-core-acpi.c
index 4dbbc9a35f6561fb918dbd663b5bd2e4cd64eee2..bb6b39fe343a80f0b3ae072e17696c5b25f382a5 100644 (file)
@@ -344,27 +344,10 @@ u32 i2c_acpi_find_bus_speed(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(i2c_acpi_find_bus_speed);
 
-static int i2c_acpi_find_match_adapter(struct device *dev, const void *data)
-{
-       struct i2c_adapter *adapter = i2c_verify_adapter(dev);
-
-       if (!adapter)
-               return 0;
-
-       return ACPI_HANDLE(dev) == (acpi_handle)data;
-}
-
-static int i2c_acpi_find_match_device(struct device *dev, const void *data)
-{
-       return ACPI_COMPANION(dev) == data;
-}
-
 struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle)
 {
-       struct device *dev;
+       struct device *dev = bus_find_device_by_acpi_dev(&i2c_bus_type, handle);
 
-       dev = bus_find_device(&i2c_bus_type, NULL, handle,
-                             i2c_acpi_find_match_adapter);
        return dev ? i2c_verify_adapter(dev) : NULL;
 }
 EXPORT_SYMBOL_GPL(i2c_acpi_find_adapter_by_handle);
@@ -373,8 +356,7 @@ static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev)
 {
        struct device *dev;
 
-       dev = bus_find_device(&i2c_bus_type, NULL, adev,
-                             i2c_acpi_find_match_device);
+       dev = bus_find_device_by_acpi_dev(&i2c_bus_type, adev);
        return dev ? i2c_verify_client(dev) : NULL;
 }