Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308471
b: refs/heads/master
c: 0938643
h: refs/heads/master
i:
  308469: 7c4fd76
  308467: 5983831
  308463: 3d33c91
v: v3
  • Loading branch information
Stephen Warren authored and Wolfram Sang committed May 12, 2012
1 parent ea2a5a8 commit f530f9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 643dd09eb27b40ced671564edbe2640935fe37c2
refs/heads/master: 0938643e533cc80ef0cdfdd2e260c4910d0f8bc7
14 changes: 14 additions & 0 deletions trunk/drivers/of/of_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,18 @@ struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
}
EXPORT_SYMBOL(of_find_i2c_device_by_node);

/* must call put_device() when done with returned i2c_adapter device */
struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
{
struct device *dev;

dev = bus_find_device(&i2c_bus_type, NULL, node,
of_dev_node_match);
if (!dev)
return NULL;

return i2c_verify_adapter(dev);
}
EXPORT_SYMBOL(of_find_i2c_adapter_by_node);

MODULE_LICENSE("GPL");
4 changes: 4 additions & 0 deletions trunk/include/linux/of_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ extern void of_i2c_register_devices(struct i2c_adapter *adap);
/* must call put_device() when done with returned i2c_client device */
extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);

/* must call put_device() when done with returned i2c_adapter device */
extern struct i2c_adapter *of_find_i2c_adapter_by_node(
struct device_node *node);

#else
static inline void of_i2c_register_devices(struct i2c_adapter *adap)
{
Expand Down

0 comments on commit f530f9b

Please sign in to comment.