i2c: atr: split up i2c_atr_get_mapping_by_addr()
authorCosmin Tanislav <demonsingur@gmail.com>
Wed, 7 May 2025 12:19:09 +0000 (15:19 +0300)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 22 May 2025 09:07:04 +0000 (11:07 +0200)
commit5988589eb38124f6eb311ada0f92a0b68625659d
tree769ee02d9dcf173b235e81e4294c631ec6e91aab
parent42a70dc49edfc230fe79e3e8141b5b8d537e7a91
i2c: atr: split up i2c_atr_get_mapping_by_addr()

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@gmail.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/i2c-atr.c