Skip to content

Commit 42a70dc

Browse files
Demon000Wolfram Sang
authored andcommitted
i2c: atr: find_mapping() -> get_mapping()
A find operation implies that a null result is not an error. Use get naming to clarify things and to prepare for splitting up the logic inside this function. 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 ec8c1b9 commit 42a70dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/i2c/i2c-atr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static void i2c_atr_release_alias(struct i2c_atr_alias_pool *alias_pool, u16 ali
241241

242242
/* Must be called with alias_pairs_lock held */
243243
static struct i2c_atr_alias_pair *
244-
i2c_atr_find_mapping_by_addr(struct i2c_atr_chan *chan, u16 addr)
244+
i2c_atr_get_mapping_by_addr(struct i2c_atr_chan *chan, u16 addr)
245245
{
246246
struct i2c_atr *atr = chan->atr;
247247
struct i2c_atr_alias_pair *c2a;
@@ -339,7 +339,7 @@ static int i2c_atr_map_msgs(struct i2c_atr_chan *chan, struct i2c_msg *msgs,
339339
for (i = 0; i < num; i++) {
340340
chan->orig_addrs[i] = msgs[i].addr;
341341

342-
c2a = i2c_atr_find_mapping_by_addr(chan, msgs[i].addr);
342+
c2a = i2c_atr_get_mapping_by_addr(chan, msgs[i].addr);
343343

344344
if (!c2a) {
345345
dev_err(atr->dev, "client 0x%02x not mapped!\n",
@@ -432,7 +432,7 @@ static int i2c_atr_smbus_xfer(struct i2c_adapter *adap, u16 addr,
432432

433433
mutex_lock(&chan->alias_pairs_lock);
434434

435-
c2a = i2c_atr_find_mapping_by_addr(chan, addr);
435+
c2a = i2c_atr_get_mapping_by_addr(chan, addr);
436436

437437
if (!c2a) {
438438
dev_err(atr->dev, "client 0x%02x not mapped!\n", addr);
@@ -540,7 +540,7 @@ static void i2c_atr_detach_addr(struct i2c_adapter *adapter,
540540

541541
mutex_lock(&chan->alias_pairs_lock);
542542

543-
c2a = i2c_atr_find_mapping_by_addr(chan, addr);
543+
c2a = i2c_atr_get_mapping_by_addr(chan, addr);
544544
if (!c2a) {
545545
/* This should never happen */
546546
dev_warn(atr->dev, "Unable to find address mapping\n");

0 commit comments

Comments
 (0)