diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-highlander.c')
-rw-r--r-- | drivers/i2c/busses/i2c-highlander.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c index ce87a902c94d..3df1bc80f37a 100644 --- a/drivers/i2c/busses/i2c-highlander.c +++ b/drivers/i2c/busses/i2c-highlander.c | |||
@@ -282,7 +282,6 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, | |||
282 | union i2c_smbus_data *data) | 282 | union i2c_smbus_data *data) |
283 | { | 283 | { |
284 | struct highlander_i2c_dev *dev = i2c_get_adapdata(adap); | 284 | struct highlander_i2c_dev *dev = i2c_get_adapdata(adap); |
285 | int read = read_write & I2C_SMBUS_READ; | ||
286 | u16 tmp; | 285 | u16 tmp; |
287 | 286 | ||
288 | init_completion(&dev->cmd_complete); | 287 | init_completion(&dev->cmd_complete); |
@@ -337,11 +336,11 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, | |||
337 | highlander_i2c_done(dev); | 336 | highlander_i2c_done(dev); |
338 | 337 | ||
339 | /* Set slave address */ | 338 | /* Set slave address */ |
340 | iowrite16((addr << 1) | read, dev->base + SMSMADR); | 339 | iowrite16((addr << 1) | read_write, dev->base + SMSMADR); |
341 | 340 | ||
342 | highlander_i2c_command(dev, command, dev->buf_len); | 341 | highlander_i2c_command(dev, command, dev->buf_len); |
343 | 342 | ||
344 | if (read) | 343 | if (read_write == I2C_SMBUS_READ) |
345 | return highlander_i2c_read(dev); | 344 | return highlander_i2c_read(dev); |
346 | else | 345 | else |
347 | return highlander_i2c_write(dev); | 346 | return highlander_i2c_write(dev); |