diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-08-06 14:17:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-13 09:13:19 +0200 |
commit | 541b84eceef116a215e7c0d8bf1d35020bd4eafb (patch) | |
tree | f1d0cdd4f799b29dcbfb402fdcf71f823eb8d9a3 /drivers/platform | |
parent | 0a732d7dfb44da367405b23a54b305d0979e02c1 (diff) | |
download | linux-541b84eceef116a215e7c0d8bf1d35020bd4eafb.tar.bz2 |
platform/surface: aggregator: Use serdev_acpi_get_uart_resource() helper
serdev provides a generic helper to get UART Serial Bus resources.
Use it instead of an open coded variant.
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.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-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/surface/aggregator/core.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c index 279d9df19c01..c61bbeeec2df 100644 --- a/drivers/platform/surface/aggregator/core.c +++ b/drivers/platform/surface/aggregator/core.c @@ -301,20 +301,13 @@ static acpi_status ssam_serdev_setup_via_acpi_crs(struct acpi_resource *rsc, void *ctx) { struct serdev_device *serdev = ctx; - struct acpi_resource_common_serialbus *serial; struct acpi_resource_uart_serialbus *uart; bool flow_control; int status = 0; - if (rsc->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) + if (!serdev_acpi_get_uart_resource(rsc, &uart)) return AE_OK; - serial = &rsc->data.common_serial_bus; - if (serial->type != ACPI_RESOURCE_SERIAL_TYPE_UART) - return AE_OK; - - uart = &rsc->data.uart_serial_bus; - /* Set up serdev device. */ serdev_device_set_baudrate(serdev, uart->default_baud_rate); |