summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratap Nirujogi <pratap.nirujogi@amd.com>2025-06-09 11:53:55 -0400
committerAndi Shyti <andi.shyti@kernel.org>2025-06-25 23:38:29 +0200
commit942e1aece13e4007656e41d3182c0adf05cf08b8 (patch)
tree3efdcd2a7ccc3ee1eab94306baeea258261f0fff
parentcbdb25ccf7566eee0c2b945e35cb98baf9ed0aa6 (diff)
i2c: designware: Initialize adapter name only when not set
Check if the adapter name is already set in the driver prior to initializing with generic name in i2c_dw_probe_master(). This check allows to retain the unique adapter name driver has initialized, which platform driver can use to distinguish it from other i2c designware adapters. Tested-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20250609155601.1477055-2-pratap.nirujogi@amd.com
-rw-r--r--drivers/i2c/busses/i2c-designware-master.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index c5394229b77f..9d7d9e47564a 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -1042,8 +1042,9 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
if (ret)
return ret;
- snprintf(adap->name, sizeof(adap->name),
- "Synopsys DesignWare I2C adapter");
+ if (!adap->name[0])
+ scnprintf(adap->name, sizeof(adap->name),
+ "Synopsys DesignWare I2C adapter");
adap->retries = 3;
adap->algo = &i2c_dw_algo;
adap->quirks = &i2c_dw_quirks;