File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -2287,19 +2287,19 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
2287
2287
2288
2288
/* Free the GPIO only in case of no use */
2289
2289
list_for_each_entry_safe (pin , n , & regulator_ena_gpio_list , list ) {
2290
- if (pin -> gpiod == rdev -> ena_pin -> gpiod ) {
2291
- if (pin -> request_count <= 1 ) {
2292
- pin -> request_count = 0 ;
2293
- gpiod_put (pin -> gpiod );
2294
- list_del (& pin -> list );
2295
- kfree (pin );
2296
- rdev -> ena_pin = NULL ;
2297
- return ;
2298
- } else {
2299
- pin -> request_count -- ;
2300
- }
2301
- }
2290
+ if (pin != rdev -> ena_pin )
2291
+ continue ;
2292
+
2293
+ if (-- pin -> request_count )
2294
+ break ;
2295
+
2296
+ gpiod_put (pin -> gpiod );
2297
+ list_del (& pin -> list );
2298
+ kfree (pin );
2299
+ break ;
2302
2300
}
2301
+
2302
+ rdev -> ena_pin = NULL ;
2303
2303
}
2304
2304
2305
2305
/**
You can’t perform that action at this time.
0 commit comments