diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-04-10 13:32:11 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2024-04-26 12:24:58 +0300 |
commit | ca88632506f40033366ec65213676fffd0661632 (patch) | |
tree | 93b5894c6459950e6464b75077bc6ffbda3ee058 /drivers/staging/media | |
parent | c780a2c6ae629e1d380753b4df8cbf0bc72f375e (diff) | |
download | linux-ca88632506f40033366ec65213676fffd0661632.tar.xz |
media: atomisp: Replace open-coded i2c_find_device_by_fwnode()
gmin_i2c_dev_exists() is using open-coded variant of
i2c_find_device_by_fwnode(). Replace it with a corresponding call.
Link: https://lore.kernel.org/r/20240326202813.1425431-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 91c403128a4d..a5e68b2cac50 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -388,20 +388,16 @@ static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name, struct i2c_client **client) { struct acpi_device *adev; - struct device *d; adev = acpi_dev_get_first_match_dev(name, NULL, -1); if (!adev) return NULL; - d = bus_find_device_by_acpi_dev(&i2c_bus_type, adev); + *client = i2c_find_device_by_fwnode(acpi_fwnode_handle(adev)); acpi_dev_put(adev); - if (!d) + if (!*client) return NULL; - *client = i2c_verify_client(d); - put_device(d); - dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n", (*client)->name, (*client)->addr, (*client)->adapter->nr); return *client; |