@@ -1037,11 +1037,6 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
1037
1037
int base = 0 ;
1038
1038
int ret ;
1039
1039
1040
- /* Only allow one set() and one set_multiple(). */
1041
- if ((gc -> set && gc -> set_rv ) ||
1042
- (gc -> set_multiple && gc -> set_multiple_rv ))
1043
- return - EINVAL ;
1044
-
1045
1040
/*
1046
1041
* First: allocate and populate the internal stat container, and
1047
1042
* set up the struct device.
@@ -2891,19 +2886,14 @@ static int gpiochip_set(struct gpio_chip *gc, unsigned int offset, int value)
2891
2886
2892
2887
lockdep_assert_held (& gc -> gpiodev -> srcu );
2893
2888
2894
- if (WARN_ON (unlikely (!gc -> set && ! gc -> set_rv )))
2889
+ if (WARN_ON (unlikely (!gc -> set_rv )))
2895
2890
return - EOPNOTSUPP ;
2896
2891
2897
- if (gc -> set_rv ) {
2898
- ret = gc -> set_rv (gc , offset , value );
2899
- if (ret > 0 )
2900
- ret = - EBADE ;
2901
-
2902
- return ret ;
2903
- }
2892
+ ret = gc -> set_rv (gc , offset , value );
2893
+ if (ret > 0 )
2894
+ ret = - EBADE ;
2904
2895
2905
- gc -> set (gc , offset , value );
2906
- return 0 ;
2896
+ return ret ;
2907
2897
}
2908
2898
2909
2899
static int gpiod_direction_output_raw_commit (struct gpio_desc * desc , int value )
@@ -2919,7 +2909,7 @@ static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value)
2919
2909
* output-only, but if there is then not even a .set() operation it
2920
2910
* is pretty tricky to drive the output line.
2921
2911
*/
2922
- if (!guard .gc -> set && ! guard . gc -> set_rv && !guard .gc -> direction_output ) {
2912
+ if (!guard .gc -> set_rv && !guard .gc -> direction_output ) {
2923
2913
gpiod_warn (desc ,
2924
2914
"%s: missing set() and direction_output() operations\n" ,
2925
2915
__func__ );
@@ -3673,11 +3663,6 @@ static int gpiochip_set_multiple(struct gpio_chip *gc,
3673
3663
return ret ;
3674
3664
}
3675
3665
3676
- if (gc -> set_multiple ) {
3677
- gc -> set_multiple (gc , mask , bits );
3678
- return 0 ;
3679
- }
3680
-
3681
3666
/* set outputs if the corresponding mask bit is set */
3682
3667
for_each_set_bit (i , mask , gc -> ngpio ) {
3683
3668
ret = gpiochip_set (gc , i , test_bit (i , bits ));
0 commit comments