@@ -744,16 +744,15 @@ static int acpi_gpio_update_gpiod_lookup_flags(unsigned long *lookupflags,
744
744
745
745
struct acpi_gpio_lookup {
746
746
struct acpi_gpio_info info ;
747
- int index ;
748
- u16 pin_index ;
749
- bool active_low ;
747
+ struct acpi_gpio_params params ;
750
748
struct gpio_desc * desc ;
751
749
int n ;
752
750
};
753
751
754
752
static int acpi_populate_gpio_lookup (struct acpi_resource * ares , void * data )
755
753
{
756
754
struct acpi_gpio_lookup * lookup = data ;
755
+ struct acpi_gpio_params * params = & lookup -> params ;
757
756
758
757
if (ares -> type != ACPI_RESOURCE_TYPE_GPIO )
759
758
return 1 ;
@@ -765,12 +764,12 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
765
764
u16 pin_index ;
766
765
767
766
if (lookup -> info .quirks & ACPI_GPIO_QUIRK_ONLY_GPIOIO && gpioint )
768
- lookup -> index ++ ;
767
+ params -> crs_entry_index ++ ;
769
768
770
- if (lookup -> n ++ != lookup -> index )
769
+ if (lookup -> n ++ != params -> crs_entry_index )
771
770
return 1 ;
772
771
773
- pin_index = lookup -> pin_index ;
772
+ pin_index = params -> line_index ;
774
773
if (pin_index >= agpio -> pin_table_length )
775
774
return 1 ;
776
775
@@ -796,7 +795,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
796
795
lookup -> info .polarity = agpio -> polarity ;
797
796
lookup -> info .triggering = agpio -> triggering ;
798
797
} else {
799
- lookup -> info .polarity = lookup -> active_low ;
798
+ lookup -> info .polarity = params -> active_low ;
800
799
}
801
800
802
801
lookup -> info .flags = acpi_gpio_to_gpiod_flags (agpio , lookup -> info .polarity );
@@ -834,7 +833,8 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, const char *p
834
833
struct acpi_gpio_lookup * lookup )
835
834
{
836
835
struct fwnode_reference_args args ;
837
- unsigned int index = lookup -> index ;
836
+ struct acpi_gpio_params * params = & lookup -> params ;
837
+ unsigned int index = params -> crs_entry_index ;
838
838
unsigned int quirks = 0 ;
839
839
int ret ;
840
840
@@ -857,9 +857,9 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, const char *p
857
857
if (args .nargs != 3 )
858
858
return - EPROTO ;
859
859
860
- lookup -> index = args .args [0 ];
861
- lookup -> pin_index = args .args [1 ];
862
- lookup -> active_low = !!args .args [2 ];
860
+ params -> crs_entry_index = args .args [0 ];
861
+ params -> line_index = args .args [1 ];
862
+ params -> active_low = !!args .args [2 ];
863
863
864
864
lookup -> info .adev = to_acpi_device_node (args .fwnode );
865
865
lookup -> info .quirks = quirks ;
@@ -897,10 +897,11 @@ static struct gpio_desc *acpi_get_gpiod_by_index(struct acpi_device *adev,
897
897
struct acpi_gpio_info * info )
898
898
{
899
899
struct acpi_gpio_lookup lookup ;
900
+ struct acpi_gpio_params * params = & lookup .params ;
900
901
int ret ;
901
902
902
903
memset (& lookup , 0 , sizeof (lookup ));
903
- lookup . index = index ;
904
+ params -> crs_entry_index = index ;
904
905
905
906
if (propname ) {
906
907
dev_dbg (& adev -> dev , "GPIO: looking up %s\n" , propname );
@@ -909,11 +910,11 @@ static struct gpio_desc *acpi_get_gpiod_by_index(struct acpi_device *adev,
909
910
if (ret )
910
911
return ERR_PTR (ret );
911
912
912
- dev_dbg (& adev -> dev , "GPIO: _DSD returned %s %d %u %u\n" ,
913
- dev_name (& lookup .info .adev -> dev ), lookup . index ,
914
- lookup . pin_index , lookup . active_low );
913
+ dev_dbg (& adev -> dev , "GPIO: _DSD returned %s %u %u %u\n" ,
914
+ dev_name (& lookup .info .adev -> dev ),
915
+ params -> crs_entry_index , params -> line_index , params -> active_low );
915
916
} else {
916
- dev_dbg (& adev -> dev , "GPIO: looking up %d in _CRS\n" , index );
917
+ dev_dbg (& adev -> dev , "GPIO: looking up %u in _CRS\n" , params -> crs_entry_index );
917
918
lookup .info .adev = adev ;
918
919
}
919
920
@@ -943,6 +944,7 @@ static struct gpio_desc *acpi_get_gpiod_from_data(struct fwnode_handle *fwnode,
943
944
struct acpi_gpio_info * info )
944
945
{
945
946
struct acpi_gpio_lookup lookup ;
947
+ struct acpi_gpio_params * params = & lookup .params ;
946
948
int ret ;
947
949
948
950
if (!is_acpi_data_node (fwnode ))
@@ -952,7 +954,7 @@ static struct gpio_desc *acpi_get_gpiod_from_data(struct fwnode_handle *fwnode,
952
954
return ERR_PTR (- EINVAL );
953
955
954
956
memset (& lookup , 0 , sizeof (lookup ));
955
- lookup . index = index ;
957
+ params -> crs_entry_index = index ;
956
958
957
959
ret = acpi_gpio_property_lookup (fwnode , propname , & lookup );
958
960
if (ret )
0 commit comments