summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-mux.c
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2016-06-29 16:04:03 +0300
committerWolfram Sang <wsa@the-dreams.de>2016-08-25 19:02:14 +0300
commitfb79e09a74faf39fbeee975e0ead442b7b7f6aac (patch)
tree465679257bdac8b169b5e5d20b17aabbd9859aef /drivers/i2c/i2c-mux.c
parent00f0ea70d2b82b7d7afeb1bdedc9169eb8ea6675 (diff)
downloadlinux-fb79e09a74faf39fbeee975e0ead442b7b7f6aac.tar.xz
i2c: add i2c_trylock_bus wrapper, use it
This unifies usage with i2c_lock_bus and i2c_unlock_bus, and paves the way for the next patch which looks a bit saner with this preparatory work taken care of beforehand. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-mux.c')
-rw-r--r--drivers/i2c/i2c-mux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 8eee98634cda..764f195795e4 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -159,7 +159,7 @@ static int i2c_mux_trylock_bus(struct i2c_adapter *adapter, unsigned int flags)
return 0; /* mux_lock not locked, failure */
if (!(flags & I2C_LOCK_ROOT_ADAPTER))
return 1; /* we only want mux_lock, success */
- if (parent->trylock_bus(parent, flags))
+ if (i2c_trylock_bus(parent, flags))
return 1; /* parent locked too, success */
rt_mutex_unlock(&parent->mux_lock);
return 0; /* parent not locked, failure */
@@ -193,7 +193,7 @@ static int i2c_parent_trylock_bus(struct i2c_adapter *adapter,
if (!rt_mutex_trylock(&parent->mux_lock))
return 0; /* mux_lock not locked, failure */
- if (parent->trylock_bus(parent, flags))
+ if (i2c_trylock_bus(parent, flags))
return 1; /* parent locked too, success */
rt_mutex_unlock(&parent->mux_lock);
return 0; /* parent not locked, failure */