Re: [PATCH v2 4/9] i2c: atr: split up i2c_atr_get_mapping_by_addr()
From: Romain Gantois
Date: Thu Feb 27 2025 - 08:50:12 EST
On mardi 25 février 2025 12:39:32 heure normale d’Europe centrale Cosmin
Tanislav wrote:
> The i2c_atr_get_mapping_by_addr() function handles three separate
> usecases: finding an existing mapping, creating a new mapping, or
> replacing an existing mapping if a new mapping cannot be created
> because there aren't enough aliases available.
>
> Split up the function into three different functions handling its
> individual usecases to prepare for better usage of each one.
>
> Signed-off-by: Cosmin Tanislav <demonsingur@xxxxxxxxx>
> ---
> drivers/i2c/i2c-atr.c | 108 ++++++++++++++++++++++++++++++------------
> 1 file changed, 79 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/i2c/i2c-atr.c b/drivers/i2c/i2c-atr.c
> index f2485d1670a2..9c4e9e8ec802 100644
> --- a/drivers/i2c/i2c-atr.c
> +++ b/drivers/i2c/i2c-atr.c
> @@ -239,9 +239,26 @@ static void i2c_atr_release_alias(struct
...
> + i2c_atr_destroy_c2a(&c2a);
> + i2c_atr_release_alias(chan->alias_pool, alias);
> + return NULL;
> +}
> +
> +static struct i2c_atr_alias_pair *
> +i2c_atr_create_mapping_by_addr(struct i2c_atr_chan *chan, u16 addr)
> +{
I've missed this on my first review of this patch, but shouldn't
i2c_atr_create_mapping_by_addr() also get a lockdep annotation, just like the
other two mapping functions?
Thanks,
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Attachment:
signature.asc
Description: This is a digitally signed message part.