platform/x86: serdev_helpers: Add get_serdev_controller_from_parent() helper
authorHans de Goede <hdegoede@redhat.com>
Wed, 4 Dec 2024 20:42:15 +0000 (21:42 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 10 Dec 2024 13:17:48 +0000 (15:17 +0200)
commita6593c5c50455852cd3b2b51e09bdec90b99738f
treef8eae85f7898efabb0f91bb0154c6964a1f6f874
parent478b00a623d6c8ae23a1be7bcc96cb5497045cef
platform/x86: serdev_helpers: Add get_serdev_controller_from_parent() helper

The x86-android-tablets code needs to be able to get a serdev_controller
device from a PCI parent, rather then by the ACPI HID+UID of the parent,
because on some tablets the UARTs are enumerated as PCI devices instead
of ACPI devices.

Split the code to walk the device hierarchy to find the serdev_controller
from its parents out into a get_serdev_controller_from_parent() helper
so that the x86-android-tablets code can re-use it.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241204204227.95757-5-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/serdev_helpers.h