diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-08-11 12:20:58 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-08-11 12:20:58 -0400 |
commit | fe61e07e9ebc890c70d97a1f72ddaad4bee2d848 (patch) | |
tree | e6ab84f0c09c555899884f2b730d205e3244dd8f /include/linux/i2c.h | |
parent | d44f19d586b6113fb5db10e1a36457f0db3b01aa (diff) |
i2c: Move adapter locking helpers to i2c-core
Uninline i2c adapter locking helper functions, move them to i2c-core,
and use them in i2c-core itself. The functions are still exported for
external users. This makes future updates to the locking model (which
will be needed for multiplexing support) possible and transparent.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Michael Lawnick <ml.lawnick@gmx.de>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index c8627e453e97..5bf0f4beea31 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -382,23 +382,9 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
382 | dev_set_drvdata(&dev->dev, data); | 382 | dev_set_drvdata(&dev->dev, data); |
383 | } | 383 | } |
384 | 384 | ||
385 | /** | 385 | /* Adapter locking functions, exported for shared pin cases */ |
386 | * i2c_lock_adapter - Prevent access to an I2C bus segment | 386 | void i2c_lock_adapter(struct i2c_adapter *); |
387 | * @adapter: Target I2C bus segment | 387 | void i2c_unlock_adapter(struct i2c_adapter *); |
388 | */ | ||
389 | static inline void i2c_lock_adapter(struct i2c_adapter *adapter) | ||
390 | { | ||
391 | rt_mutex_lock(&adapter->bus_lock); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * i2c_unlock_adapter - Reauthorize access to an I2C bus segment | ||
396 | * @adapter: Target I2C bus segment | ||
397 | */ | ||
398 | static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) | ||
399 | { | ||
400 | rt_mutex_unlock(&adapter->bus_lock); | ||
401 | } | ||
402 | 388 | ||
403 | /*flags for the client struct: */ | 389 | /*flags for the client struct: */ |
404 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ | 390 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ |