History

gpiolib: Make use of enum gpio_lookup_flags consistent

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.

Andy Shevchenko committed 7 years ago

Commit fed70261 parent 40505865 files · +28 −27Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/gpio/machine.h+4−4
@@ -22,7 +22,7 @@ enum gpio_lookup_flags { · 21 unmodified lines
2222 * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
2323 * @con_id: name of the GPIO from the device's point of view
2424 * @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
2626 *
2727 * gpiod_lookup is a lookup table for associating GPIOs to specific devices and
2828 * functions using platform data.
@@ -32,7 +32,7 @@ struct gpiod_lookup { · 3 unmodified lines
3232 u16 chip_hwnum;
3333 const char *con_id;
3434 unsigned int idx;
35− enum gpio_lookup_flags flags;
35+ unsigned long flags;
3636 };
3737
3838 struct gpiod_lookup_table {
@@ -46,7 +46,7 @@ struct gpiod_lookup_table { · 7 unmodified lines
4646 * @chip_label: name of the chip the GPIO belongs to
4747 * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
4848 * @line_name: consumer name for the hogged line
49− * @lflags: mask of GPIO lookup flags
49+ * @lflags: bitmask of gpio_lookup_flags GPIO_* values
5050 * @dflags: GPIO flags used to specify the direction and value
5151 */
5252 struct gpiod_hog {
@@ -54,7 +54,7 @@ struct gpiod_hog { · 1 unmodified line
5454 const char *chip_label;
5555 u16 chip_hwnum;
5656 const char *line_name;
57− enum gpio_lookup_flags lflags;
57+ unsigned long lflags;
5858 int dflags;
5959 };
6060

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t