]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
platform/surface: aggregator: Use serdev_acpi_get_uart_resource() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 6 Aug 2021 11:17:36 +0000 (14:17 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Aug 2021 07:13:19 +0000 (09:13 +0200)
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>
drivers/platform/surface/aggregator/core.c

index 279d9df19c0174f5dfcf8649eb3506133d56d67e..c61bbeeec2dfd8f9da0955c8f76456b5dfe20d22 100644 (file)
@@ -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);