From fe61e07e9ebc890c70d97a1f72ddaad4bee2d848 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 11 Aug 2010 18:20:58 +0200 Subject: 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 Cc: Michael Lawnick --- include/linux/i2c.h | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'include/linux/i2c.h') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index c8627e453e9..5bf0f4beea3 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) dev_set_drvdata(&dev->dev, data); } -/** - * i2c_lock_adapter - Prevent access to an I2C bus segment - * @adapter: Target I2C bus segment - */ -static inline void i2c_lock_adapter(struct i2c_adapter *adapter) -{ - rt_mutex_lock(&adapter->bus_lock); -} - -/** - * i2c_unlock_adapter - Reauthorize access to an I2C bus segment - * @adapter: Target I2C bus segment - */ -static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) -{ - rt_mutex_unlock(&adapter->bus_lock); -} +/* Adapter locking functions, exported for shared pin cases */ +void i2c_lock_adapter(struct i2c_adapter *); +void i2c_unlock_adapter(struct i2c_adapter *); /*flags for the client struct: */ #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ -- cgit v1.2.3-70-g09d2