diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2018-07-13 00:12:53 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-07-13 00:12:53 +0200 |
commit | fb2896a77989314ea89d89c3bdfee93002a760c9 (patch) | |
tree | 19df2cde875a69bcfe50296a2c9ae204ffdba0c1 /drivers/i2c/busses/i2c-gpio.c | |
parent | i2c: i801: Add support for Intel Ice Lake (diff) | |
parent | i2c: remove i2c_lock_adapter and use i2c_lock_bus directly (diff) | |
download | linux-fb2896a77989314ea89d89c3bdfee93002a760c9.tar.xz linux-fb2896a77989314ea89d89c3bdfee93002a760c9.zip |
Merge branch 'i2c/precise-locking-names_immutable' into i2c/for-4.19
Diffstat (limited to 'drivers/i2c/busses/i2c-gpio.c')
-rw-r--r-- | drivers/i2c/busses/i2c-gpio.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index ac00b8e08251..c008d209f0b8 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -78,24 +78,24 @@ static struct dentry *i2c_gpio_debug_dir; #define getscl(bd) ((bd)->getscl((bd)->data)) #define WIRE_ATTRIBUTE(wire) \ -static int fops_##wire##_get(void *data, u64 *val) \ -{ \ - struct i2c_gpio_private_data *priv = data; \ - \ - i2c_lock_adapter(&priv->adap); \ - *val = get##wire(&priv->bit_data); \ - i2c_unlock_adapter(&priv->adap); \ - return 0; \ -} \ -static int fops_##wire##_set(void *data, u64 val) \ -{ \ - struct i2c_gpio_private_data *priv = data; \ - \ - i2c_lock_adapter(&priv->adap); \ - set##wire(&priv->bit_data, val); \ - i2c_unlock_adapter(&priv->adap); \ - return 0; \ -} \ +static int fops_##wire##_get(void *data, u64 *val) \ +{ \ + struct i2c_gpio_private_data *priv = data; \ + \ + i2c_lock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + *val = get##wire(&priv->bit_data); \ + i2c_unlock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + return 0; \ +} \ +static int fops_##wire##_set(void *data, u64 val) \ +{ \ + struct i2c_gpio_private_data *priv = data; \ + \ + i2c_lock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + set##wire(&priv->bit_data, val); \ + i2c_unlock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + return 0; \ +} \ DEFINE_DEBUGFS_ATTRIBUTE(fops_##wire, fops_##wire##_get, fops_##wire##_set, "%llu\n") WIRE_ATTRIBUTE(scl); @@ -107,7 +107,7 @@ static void i2c_gpio_incomplete_transfer(struct i2c_gpio_private_data *priv, struct i2c_algo_bit_data *bit_data = &priv->bit_data; int i; - i2c_lock_adapter(&priv->adap); + i2c_lock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); /* START condition */ setsda(bit_data, 0); @@ -123,7 +123,7 @@ static void i2c_gpio_incomplete_transfer(struct i2c_gpio_private_data *priv, udelay(bit_data->udelay); } - i2c_unlock_adapter(&priv->adap); + i2c_unlock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); } static int fops_incomplete_addr_phase_set(void *data, u64 addr) |