Skip to content

Commit

Permalink
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "Two i2c driver bugfixes"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: qup: Fix order of runtime pm initialization
  i2c: rk3x: fix 0 length write transfers
  • Loading branch information
torvalds committed Oct 3, 2014
2 parents 0390019 + 86b59bb commit 126d457
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions drivers/i2c/busses/i2c-qup.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,16 +674,20 @@ static int qup_i2c_probe(struct platform_device *pdev)
qup->adap.dev.of_node = pdev->dev.of_node;
strlcpy(qup->adap.name, "QUP I2C adapter", sizeof(qup->adap.name));

ret = i2c_add_adapter(&qup->adap);
if (ret)
goto fail;

pm_runtime_set_autosuspend_delay(qup->dev, MSEC_PER_SEC);
pm_runtime_use_autosuspend(qup->dev);
pm_runtime_set_active(qup->dev);
pm_runtime_enable(qup->dev);

ret = i2c_add_adapter(&qup->adap);
if (ret)
goto fail_runtime;

return 0;

fail_runtime:
pm_runtime_disable(qup->dev);
pm_runtime_set_suspended(qup->dev);
fail:
qup_i2c_disable_clocks(qup);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-rk3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static void rk3x_i2c_fill_transmit_buf(struct rk3x_i2c *i2c)
for (i = 0; i < 8; ++i) {
val = 0;
for (j = 0; j < 4; ++j) {
if (i2c->processed == i2c->msg->len)
if ((i2c->processed == i2c->msg->len) && (cnt != 0))
break;

if (i2c->processed == 0 && cnt == 0)
Expand Down

0 comments on commit 126d457

Please sign in to comment.