History

gpiolib: introduce fwnode_gpiod_get_index()

This introduces fwnode_gpiod_get_index() that iterates through common gpio suffixes when trying to locate a GPIO within a given firmware node. We also switch devm_fwnode_gpiod_get_index() to call fwnode_gpiod_get_index() instead of iterating through GPIO suffixes on its own.

Dmitry Torokhov committed 7 years ago

Commit 13949fa1 parent 2d2f1163 files · +62 −15Browse files

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

Unified · Split

include/linux/gpio/consumer.h+13−0
@@ -176,6 +176,10 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, · 175 unmodified lines
176176 const char *propname, int index,
177177 enum gpiod_flags dflags,
178178 const char *label);
179+struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,
180+ const char *con_id, int index,
181+ enum gpiod_flags flags,
182+ const char *label);
179183 struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
180184 struct fwnode_handle *child,
181185 const char *con_id, int index,
@@ -531,6 +535,15 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, · 349 unmodified lines
531535 return ERR_PTR(-ENOSYS);
532536 }
533537
538+static inline
539+struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,
540+ const char *con_id, int index,
541+ enum gpiod_flags flags,
542+ const char *label)
543+{
544+ return ERR_PTR(-ENOSYS);
545+}
546+
534547 static inline
535548 struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
536549 struct fwnode_handle *fwnode,

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