Skip to content

Commit b01fe98

Browse files
committed
Merge tag 'i2c-for-6.3-rc1-part2' of git://git.kernel.org/pub/scm/linux/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
2 parents e77d587 + 65609d3 commit b01fe98

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

drivers/i2c/busses/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ config I2C_PASEMI
914914

915915
config I2C_APPLE
916916
tristate "Apple SMBus platform driver"
917+
depends on !I2C_PASEMI
917918
depends on ARCH_APPLE || COMPILE_TEST
918919
default ARCH_APPLE
919920
help

drivers/i2c/busses/i2c-gxp.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,13 @@ static int gxp_i2c_master_xfer(struct i2c_adapter *adapter,
126126
time_left = wait_for_completion_timeout(&drvdata->completion,
127127
adapter->timeout);
128128
ret = num - drvdata->msgs_remaining;
129-
if (time_left == 0) {
130-
switch (drvdata->state) {
131-
case GXP_I2C_WDATA_PHASE:
132-
break;
133-
case GXP_I2C_RDATA_PHASE:
134-
break;
135-
case GXP_I2C_ADDR_PHASE:
136-
break;
137-
default:
138-
break;
139-
}
129+
if (time_left == 0)
140130
return -ETIMEDOUT;
141-
}
142131

143-
if (drvdata->state == GXP_I2C_ADDR_NACK ||
144-
drvdata->state == GXP_I2C_DATA_NACK)
132+
if (drvdata->state == GXP_I2C_ADDR_NACK)
133+
return -ENXIO;
134+
135+
if (drvdata->state == GXP_I2C_DATA_NACK)
145136
return -EIO;
146137

147138
return ret;
@@ -525,7 +516,7 @@ static int gxp_i2c_probe(struct platform_device *pdev)
525516
i2cg_map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
526517
"hpe,sysreg");
527518
if (IS_ERR(i2cg_map)) {
528-
return dev_err_probe(&pdev->dev, IS_ERR(i2cg_map),
519+
return dev_err_probe(&pdev->dev, PTR_ERR(i2cg_map),
529520
"failed to map i2cg_handle\n");
530521
}
531522

0 commit comments

Comments
 (0)