Skip to content

Commit d5ab616

Browse files
committed
gpiolib: acpi: Remove index parameter from acpi_gpio_property_lookup()
In all cases the supplied index is the same as the passed one in the struct acpi_gpio_lookup. Remove index parameter and reuse one from the struct acpi_gpio_lookup instead. add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-14 (-14) Function old new delta acpi_get_gpiod_by_index 462 456 -6 acpi_gpio_property_lookup 425 417 -8 Total: Before=15375, After=15361, chg -0.09% Acked-by: Mika Westerberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 2c6c34e commit d5ab616

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -830,17 +830,17 @@ static int acpi_gpio_resource_lookup(struct acpi_gpio_lookup *lookup,
830830
return 0;
831831
}
832832

833-
static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode,
834-
const char *propname, int index,
833+
static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, const char *propname,
835834
struct acpi_gpio_lookup *lookup)
836835
{
837836
struct fwnode_reference_args args;
837+
unsigned int index = lookup->index;
838838
unsigned int quirks = 0;
839839
int ret;
840840

841841
memset(&args, 0, sizeof(args));
842-
ret = __acpi_node_get_property_reference(fwnode, propname, index, 3,
843-
&args);
842+
843+
ret = __acpi_node_get_property_reference(fwnode, propname, index, 3, &args);
844844
if (ret) {
845845
struct acpi_device *adev;
846846

@@ -905,8 +905,7 @@ static struct gpio_desc *acpi_get_gpiod_by_index(struct acpi_device *adev,
905905
if (propname) {
906906
dev_dbg(&adev->dev, "GPIO: looking up %s\n", propname);
907907

908-
ret = acpi_gpio_property_lookup(acpi_fwnode_handle(adev),
909-
propname, index, &lookup);
908+
ret = acpi_gpio_property_lookup(acpi_fwnode_handle(adev), propname, &lookup);
910909
if (ret)
911910
return ERR_PTR(ret);
912911

@@ -955,7 +954,7 @@ static struct gpio_desc *acpi_get_gpiod_from_data(struct fwnode_handle *fwnode,
955954
memset(&lookup, 0, sizeof(lookup));
956955
lookup.index = index;
957956

958-
ret = acpi_gpio_property_lookup(fwnode, propname, index, &lookup);
957+
ret = acpi_gpio_property_lookup(fwnode, propname, &lookup);
959958
if (ret)
960959
return ERR_PTR(ret);
961960

0 commit comments

Comments
 (0)