i2c: acpi: Add i2c_acpi_new_device_by_fwnode() function
authorHans de Goede <hdegoede@redhat.com>
Fri, 3 Dec 2021 10:28:46 +0000 (11:28 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 13 Dec 2021 10:44:47 +0000 (11:44 +0100)
commitc537be0bfad6337f2afd618fe252c03217191405
tree863eb0b5e8bd24b09fe40beace8d3c33312d9543
parentfb90e58f7c4e406d510f301e156e2056a4357130
i2c: acpi: Add i2c_acpi_new_device_by_fwnode() function

Change i2c_acpi_new_device() into i2c_acpi_new_device_by_fwnode() and
add a static inline wrapper providing the old i2c_acpi_new_device()
behavior.

This is necessary because in some cases we may only have access
to the fwnode / acpi_device and not to the matching physical-node
struct device *.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211203102857.44539-4-hdegoede@redhat.com
drivers/i2c/i2c-core-acpi.c
include/linux/i2c.h