serdev: Split and export serdev_acpi_get_uart_resource()

The same as for I²C Serial Bus resource split and export
serdev_acpi_get_uart_resource(). We have already a few users
one of which is converted here.

Rationale of this is to consolidate parsing UART Serial Bus
resource in one place as it's done, e.g., for I²C Serial Bus.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210806111736.66591-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Andy Shevchenko
2021-08-06 14:17:35 +03:00
committed by Greg Kroah-Hartman
parent 217b04c67b
commit 0a732d7dfb
2 changed files with 43 additions and 7 deletions

View File

@@ -327,4 +327,18 @@ static inline int serdev_tty_port_unregister(struct tty_port *port)
}
#endif /* CONFIG_SERIAL_DEV_CTRL_TTYPORT */
struct acpi_resource;
struct acpi_resource_uart_serialbus;
#ifdef CONFIG_ACPI
bool serdev_acpi_get_uart_resource(struct acpi_resource *ares,
struct acpi_resource_uart_serialbus **uart);
#else
static inline bool serdev_acpi_get_uart_resource(struct acpi_resource *ares,
struct acpi_resource_uart_serialbus **uart)
{
return false;
}
#endif /* CONFIG_ACPI */
#endif /*_LINUX_SERDEV_H */