Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114487
b: refs/heads/master
c: 1d0b19c
h: refs/heads/master
i:
  114485: bb046cd
  114483: cdf3bc5
  114479: 98104f7
v: v3
  • Loading branch information
David Brownell authored and Jean Delvare committed Oct 14, 2008
1 parent 05abc28 commit 1177073
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 7c15fd1249658e203b2ac8661e48da6c2102e563
refs/heads/master: 1d0b19c9a0612c653d1a0df267ba159089f6d139
8 changes: 8 additions & 0 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
{
int res = 0, dummy;

/* Can't register until after driver model init */
if (unlikely(WARN_ON(!i2c_bus_type.p)))
return -EAGAIN;

mutex_init(&adap->bus_lock);
mutex_init(&adap->clist_lock);
INIT_LIST_HEAD(&adap->clients);
Expand Down Expand Up @@ -696,6 +700,10 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
{
int res;

/* Can't register until after driver model init */
if (unlikely(WARN_ON(!i2c_bus_type.p)))
return -EAGAIN;

/* new style driver methods can't mix with legacy ones */
if (is_newstyle_driver(driver)) {
if (driver->attach_adapter || driver->detach_adapter
Expand Down

0 comments on commit 1177073

Please sign in to comment.