Re: [PATCH v4 4/9] i2c: use client addresses directly in ATR interface

From: Tomi Valkeinen
Date: Wed Jan 08 2025 - 08:38:28 EST


Hi,

On 08/01/2025 15:31, Romain Gantois wrote:
Hi,

On lundi 6 janvier 2025 10:51:20 heure normale d’Europe centrale Tomi
Valkeinen wrote:
Hi,

On 30/12/2024 15:22, Romain Gantois wrote:
The I2C Address Translator (ATR) module defines mappings from i2c_client
structs to aliases. However, only the physical address of each i2c_client
...

- dev_dbg(atr->dev, "chan%u: client 0x%02x mapped at alias 0x%02x (%s)
\n",
- chan->chan_id, client->addr, alias, client->name);
+ dev_dbg(atr->dev, "chan%u: addr 0x%02x mapped at alias 0x%02x\n",
+ chan->chan_id, addr, alias);

This, and the dev_dbg() below, sound a bit odd to my ear. But I'm not
sure what would be a good print... "added alias 0x12 for address 0x34"?

Maybe "assigned address 0x34 to alias 0x12"? Since the alias doesn't really go
anywhere, we just assign different downstream addresses to it.

I guess it's how you look at this =). I like to think it (in this order): alias -> address, as it's basically a mapping. So a debug print that prints the alias first and address second feels more natural. "using alias 0x12 for address 0x34"?

But this is nit-picking, I don't have any strong views here.

Tomi