]> Git Repo - linux.git/commitdiff
Input: goodix - switch use of acpi_gpio_get_*_resource() APIs
authorAndy Shevchenko <[email protected]>
Wed, 6 Jul 2022 23:29:11 +0000 (16:29 -0700)
committerDmitry Torokhov <[email protected]>
Wed, 6 Jul 2022 23:29:50 +0000 (16:29 -0700)
No need to open code functionality that is provided by the
acpi_gpio_get_irq_resource() and acpi_gpio_get_io_resource().

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/touchscreen/goodix.c

index 3ad9870db1081f825e1a5076c60121b46410c70c..cc52f0d21dbb8dbd81a9df067a06db0f5e25a575 100644 (file)
@@ -822,22 +822,16 @@ static int goodix_resource(struct acpi_resource *ares, void *data)
        struct device *dev = &ts->client->dev;
        struct acpi_resource_gpio *gpio;
 
-       switch (ares->type) {
-       case ACPI_RESOURCE_TYPE_GPIO:
-               gpio = &ares->data.gpio;
-               if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) {
-                       if (ts->gpio_int_idx == -1) {
-                               ts->gpio_int_idx = ts->gpio_count;
-                       } else {
-                               dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n");
-                               ts->gpio_int_idx = -2;
-                       }
+       if (acpi_gpio_get_irq_resource(ares, &gpio)) {
+               if (ts->gpio_int_idx == -1) {
+                       ts->gpio_int_idx = ts->gpio_count;
+               } else {
+                       dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n");
+                       ts->gpio_int_idx = -2;
                }
                ts->gpio_count++;
-               break;
-       default:
-               break;
-       }
+       } else if (acpi_gpio_get_io_resource(ares, &gpio))
+               ts->gpio_count++;
 
        return 0;
 }
This page took 0.124521 seconds and 4 git commands to generate.