History

driver core: Add fwnode_to_dev() to look up device from fwnode

It's often useful to look up a device that corresponds to a fwnode. So add an API to do that irrespective of the bus on which the device has been added to.

Saravana Kannan committed 7 years ago

Commit 372a67c1 parent 54ecb8f2 files · +9 −0Browse files

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

Unified · Split

include/linux/fwnode.h+2−0
@@ -17,6 +17,7 @@ struct device; · 16 unmodified lines
17struct fwnode_handle {17struct fwnode_handle {
18 struct fwnode_handle *secondary;18 struct fwnode_handle *secondary;
19 const struct fwnode_operations *ops;19 const struct fwnode_operations *ops;
20 struct device *dev;
20};21};
21 22
22/**23/**
@@ -123,5 +124,6 @@ struct fwnode_operations { · 100 unmodified lines
123 if (fwnode_has_op(fwnode, op)) \124 if (fwnode_has_op(fwnode, op)) \
124 (fwnode)->ops->op(fwnode, ## __VA_ARGS__); \125 (fwnode)->ops->op(fwnode, ## __VA_ARGS__); \
125 } while (false)126 } while (false)
127#define get_dev_from_fwnode(fwnode) get_device((fwnode)->dev)
126 128
127#endif129#endif

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