Skip to content

Commit

Permalink
Merge tag 'i2c-for-6.3-rc1-part2' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/wsa/linux

Pull more i2c updates from Wolfram Sang:
 "Some improvements/fixes for the newly added GXP driver and a Kconfig
  dependency fix"

* tag 'i2c-for-6.3-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: gxp: fix an error code in probe
  i2c: gxp: return proper error on address NACK
  i2c: gxp: remove "empty" switch statement
  i2c: Disable I2C_APPLE when I2C_PASEMI is a builtin
  • Loading branch information
Linus Torvalds committed Mar 4, 2023
2 parents e77d587 + 65609d3 commit b01fe98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
1 change: 1 addition & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ config I2C_PASEMI

config I2C_APPLE
tristate "Apple SMBus platform driver"
depends on !I2C_PASEMI
depends on ARCH_APPLE || COMPILE_TEST
default ARCH_APPLE
help
Expand Down
21 changes: 6 additions & 15 deletions drivers/i2c/busses/i2c-gxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,13 @@ static int gxp_i2c_master_xfer(struct i2c_adapter *adapter,
time_left = wait_for_completion_timeout(&drvdata->completion,
adapter->timeout);
ret = num - drvdata->msgs_remaining;
if (time_left == 0) {
switch (drvdata->state) {
case GXP_I2C_WDATA_PHASE:
break;
case GXP_I2C_RDATA_PHASE:
break;
case GXP_I2C_ADDR_PHASE:
break;
default:
break;
}
if (time_left == 0)
return -ETIMEDOUT;
}

if (drvdata->state == GXP_I2C_ADDR_NACK ||
drvdata->state == GXP_I2C_DATA_NACK)
if (drvdata->state == GXP_I2C_ADDR_NACK)
return -ENXIO;

if (drvdata->state == GXP_I2C_DATA_NACK)
return -EIO;

return ret;
Expand Down Expand Up @@ -525,7 +516,7 @@ static int gxp_i2c_probe(struct platform_device *pdev)
i2cg_map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
"hpe,sysreg");
if (IS_ERR(i2cg_map)) {
return dev_err_probe(&pdev->dev, IS_ERR(i2cg_map),
return dev_err_probe(&pdev->dev, PTR_ERR(i2cg_map),
"failed to map i2cg_handle\n");
}

Expand Down

0 comments on commit b01fe98

Please sign in to comment.