Skip to content

Commit 5efe815

Browse files
Demon000Wolfram Sang
authored andcommitted
i2c: atr: do not create mapping in detach_addr()
It is useless to create a new mapping just to detach it immediately. Use the newly added i2c_atr_find_mapping_by_addr() function to avoid it, and exit without logging an error if not found. Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
1 parent 5988589 commit 5efe815

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/i2c/i2c-atr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,8 @@ static void i2c_atr_detach_addr(struct i2c_adapter *adapter,
586586

587587
mutex_lock(&chan->alias_pairs_lock);
588588

589-
c2a = i2c_atr_get_mapping_by_addr(chan, addr);
589+
c2a = i2c_atr_find_mapping_by_addr(chan, addr);
590590
if (!c2a) {
591-
/* This should never happen */
592-
dev_warn(atr->dev, "Unable to find address mapping\n");
593591
mutex_unlock(&chan->alias_pairs_lock);
594592
return;
595593
}

0 commit comments

Comments
 (0)