mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
Merge branch 'i2c/immutable/scoped_fwnode_child' into i2c/for-mergewindow
This commit is contained in:
commit
54d6a978bb
|
|
@ -112,10 +112,9 @@ bool i2c_detect_slave_mode(struct device *dev)
|
|||
struct fwnode_handle *fwnode = dev_fwnode(dev);
|
||||
|
||||
if (is_of_node(fwnode)) {
|
||||
struct fwnode_handle *child __free(fwnode_handle) = NULL;
|
||||
u32 reg;
|
||||
|
||||
fwnode_for_each_child_node(fwnode, child) {
|
||||
fwnode_for_each_child_node_scoped(fwnode, child) {
|
||||
fwnode_property_read_u32(child, "reg", ®);
|
||||
if (reg & I2C_OWN_SLAVE_ADDRESS)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -176,6 +176,16 @@ struct fwnode_handle *fwnode_get_next_available_child_node(
|
|||
for (child = fwnode_get_next_available_child_node(fwnode, NULL); child;\
|
||||
child = fwnode_get_next_available_child_node(fwnode, child))
|
||||
|
||||
#define fwnode_for_each_child_node_scoped(fwnode, child) \
|
||||
for (struct fwnode_handle *child __free(fwnode_handle) = \
|
||||
fwnode_get_next_child_node(fwnode, NULL); \
|
||||
child; child = fwnode_get_next_child_node(fwnode, child))
|
||||
|
||||
#define fwnode_for_each_available_child_node_scoped(fwnode, child) \
|
||||
for (struct fwnode_handle *child __free(fwnode_handle) = \
|
||||
fwnode_get_next_available_child_node(fwnode, NULL); \
|
||||
child; child = fwnode_get_next_available_child_node(fwnode, child))
|
||||
|
||||
struct fwnode_handle *device_get_next_child_node(const struct device *dev,
|
||||
struct fwnode_handle *child);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user