Skip to content

Commit cefc06e

Browse files
committed
Merge tag 'i2c-for-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Usual business: a driver fix, a DT fix, a minor core fix" * tag 'i2c-for-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: npcm7xx: Fix callback completion ordering i2c: mux: Avoid potential false error message in i2c_mux_add_adapter dt-bindings: i2c: mxs: Pass ref and 'unevaluatedProperties: false'
2 parents 830380e + 92e73d8 commit cefc06e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Documentation/devicetree/bindings/i2c/i2c-mxs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ title: Freescale MXS Inter IC (I2C) Controller
99
maintainers:
1010
- Shawn Guo <shawnguo@kernel.org>
1111

12+
allOf:
13+
- $ref: /schemas/i2c/i2c-controller.yaml#
14+
1215
properties:
1316
compatible:
1417
enum:
@@ -37,7 +40,7 @@ required:
3740
- dmas
3841
- dma-names
3942

40-
additionalProperties: false
43+
unevaluatedProperties: false
4144

4245
examples:
4346
- |

drivers/i2c/busses/i2c-npcm7xx.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ static void npcm_i2c_callback(struct npcm_i2c *bus,
694694
{
695695
struct i2c_msg *msgs;
696696
int msgs_num;
697+
bool do_complete = false;
697698

698699
msgs = bus->msgs;
699700
msgs_num = bus->msgs_num;
@@ -722,23 +723,17 @@ static void npcm_i2c_callback(struct npcm_i2c *bus,
722723
msgs[1].flags & I2C_M_RD)
723724
msgs[1].len = info;
724725
}
725-
if (completion_done(&bus->cmd_complete) == false)
726-
complete(&bus->cmd_complete);
727-
break;
728-
726+
do_complete = true;
727+
break;
729728
case I2C_NACK_IND:
730729
/* MASTER transmit got a NACK before tx all bytes */
731730
bus->cmd_err = -ENXIO;
732-
if (bus->master_or_slave == I2C_MASTER)
733-
complete(&bus->cmd_complete);
734-
731+
do_complete = true;
735732
break;
736733
case I2C_BUS_ERR_IND:
737734
/* Bus error */
738735
bus->cmd_err = -EAGAIN;
739-
if (bus->master_or_slave == I2C_MASTER)
740-
complete(&bus->cmd_complete);
741-
736+
do_complete = true;
742737
break;
743738
case I2C_WAKE_UP_IND:
744739
/* I2C wake up */
@@ -752,6 +747,8 @@ static void npcm_i2c_callback(struct npcm_i2c *bus,
752747
if (bus->slave)
753748
bus->master_or_slave = I2C_SLAVE;
754749
#endif
750+
if (do_complete)
751+
complete(&bus->cmd_complete);
755752
}
756753

757754
static u8 npcm_i2c_fifo_usage(struct npcm_i2c *bus)

drivers/i2c/i2c-mux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
341341
priv->adap.lock_ops = &i2c_parent_lock_ops;
342342

343343
/* Sanity check on class */
344-
if (i2c_mux_parent_classes(parent) & class)
344+
if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED)
345345
dev_err(&parent->dev,
346346
"Segment %d behind mux can't share classes with ancestors\n",
347347
chan_id);

0 commit comments

Comments
 (0)