The library uses enum gpio_lookup_flags to define the possible characteristics of GPIO pin. Since enumerator listed only individual bits the common use of it is in a form of a bitmask of gpio_lookup_flags GPIO_* values. The more correct type for this is unsigned long. Due to above convert all users to use unsigned long instead of enum gpio_lookup_flags except enumerator definition. While here, make field and parameter descriptions consistent as well.
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -22,7 +22,7 @@ enum gpio_lookup_flags { · 21 unmodified lines | ||
| 22 | 22 | * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO |
| 23 | 23 | * @con_id: name of the GPIO from the device's point of view |
| 24 | 24 | * @idx: index of the GPIO in case several GPIOs share the same name |
| 25 | − * @flags: mask of GPIO_* values | |
| 25 | + * @flags: bitmask of gpio_lookup_flags GPIO_* values | |
| 26 | 26 | * |
| 27 | 27 | * gpiod_lookup is a lookup table for associating GPIOs to specific devices and |
| 28 | 28 | * functions using platform data. |
| @@ -32,7 +32,7 @@ struct gpiod_lookup { · 3 unmodified lines | ||
| 32 | 32 | u16 chip_hwnum; |
| 33 | 33 | const char *con_id; |
| 34 | 34 | unsigned int idx; |
| 35 | − enum gpio_lookup_flags flags; | |
| 35 | + unsigned long flags; | |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | 38 | struct gpiod_lookup_table { |
| @@ -46,7 +46,7 @@ struct gpiod_lookup_table { · 7 unmodified lines | ||
| 46 | 46 | * @chip_label: name of the chip the GPIO belongs to |
| 47 | 47 | * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO |
| 48 | 48 | * @line_name: consumer name for the hogged line |
| 49 | − * @lflags: mask of GPIO lookup flags | |
| 49 | + * @lflags: bitmask of gpio_lookup_flags GPIO_* values | |
| 50 | 50 | * @dflags: GPIO flags used to specify the direction and value |
| 51 | 51 | */ |
| 52 | 52 | struct gpiod_hog { |
| @@ -54,7 +54,7 @@ struct gpiod_hog { · 1 unmodified line | ||
| 54 | 54 | const char *chip_label; |
| 55 | 55 | u16 chip_hwnum; |
| 56 | 56 | const char *line_name; |
| 57 | − enum gpio_lookup_flags lflags; | |
| 57 | + unsigned long lflags; | |
| 58 | 58 | int dflags; |
| 59 | 59 | }; |
| 60 | 60 | |