Commit 4cd3ef01 authored by Andy Shevchenko's avatar Andy Shevchenko

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: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 4fa4c499
...@@ -974,20 +974,14 @@ __acpi_find_gpio(struct fwnode_handle *fwnode, const char *con_id, unsigned int ...@@ -974,20 +974,14 @@ __acpi_find_gpio(struct fwnode_handle *fwnode, const char *con_id, unsigned int
return ERR_CAST(desc); return ERR_CAST(desc);
if (!IS_ERR(desc)) if (!IS_ERR(desc))
break; return desc;
} }
/* Then from plain _CRS GPIOs */ /* Then from plain _CRS GPIOs */
if (IS_ERR(desc)) {
if (!adev || !acpi_can_fallback_to_crs(adev, con_id)) if (!adev || !acpi_can_fallback_to_crs(adev, con_id))
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
desc = acpi_get_gpiod_by_index(adev, NULL, idx, info); return acpi_get_gpiod_by_index(adev, NULL, idx, info);
if (IS_ERR(desc))
return desc;
}
return desc;
} }
struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode, struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment