aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAndy Shevchenko2024-04-11 20:22:30 +0300
committerAndy Shevchenko2024-04-15 16:12:18 +0300
commit4cd3ef01f60e97422fc9679e4a8d3869188851da (patch)
tree8e9f2ca29fb024a2e61609c505baf9000e70ccd3 /drivers/gpio
parent4fa4c499af53c9338a790798ca44534866b7708c (diff)
gpiolib: acpi: Simplify error handling in __acpi_find_gpio()
Now that we don't perform anything on the GPIO descriptor, we may simplify the error path in newly introduced helper. Do it so. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib-acpi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index d47b22ac3ecb..fb2e14670b7a 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -974,20 +974,14 @@ __acpi_find_gpio(struct fwnode_handle *fwnode, const char *con_id, unsigned int
return ERR_CAST(desc);
if (!IS_ERR(desc))
- break;
+ return desc;
}
/* Then from plain _CRS GPIOs */
- if (IS_ERR(desc)) {
- if (!adev || !acpi_can_fallback_to_crs(adev, con_id))
- return ERR_PTR(-ENOENT);
-
- desc = acpi_get_gpiod_by_index(adev, NULL, idx, info);
- if (IS_ERR(desc))
- return desc;
- }
+ if (!adev || !acpi_can_fallback_to_crs(adev, con_id))
+ return ERR_PTR(-ENOENT);
- return desc;
+ return acpi_get_gpiod_by_index(adev, NULL, idx, info);
}
struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,