Skip to content

Commit 942e1ae

Browse files
Pratap NirujogiAndi Shyti
authored andcommitted
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 <[email protected]> Signed-off-by: Pratap Nirujogi <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cbdb25c commit 942e1ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/i2c/busses/i2c-designware-master.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,9 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
10421042
if (ret)
10431043
return ret;
10441044

1045-
snprintf(adap->name, sizeof(adap->name),
1046-
"Synopsys DesignWare I2C adapter");
1045+
if (!adap->name[0])
1046+
scnprintf(adap->name, sizeof(adap->name),
1047+
"Synopsys DesignWare I2C adapter");
10471048
adap->retries = 3;
10481049
adap->algo = &i2c_dw_algo;
10491050
adap->quirks = &i2c_dw_quirks;

0 commit comments

Comments
 (0)