Skip to content

Commit 1d366c2

Browse files
robhancocksedwsakernel
authored andcommitted
i2c: xiic: Make bus names unique
This driver is for an FPGA logic core, so there can be arbitrarily many instances of the bus on a given system. Previously all of the I2C bus names were "xiic-i2c" which caused issues with lm_sensors when trying to map human-readable names to sensor inputs because it could not properly distinguish the busses, for example. Append the platform device name to the I2C bus name so it is unique between different instances. Fixes: e1d5b65 ("i2c: Add support for Xilinx XPS IIC Bus Interface") Signed-off-by: Robert Hancock <[email protected]> Tested-by: Michal Simek <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 55b6f82 commit 1d366c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/i2c/busses/i2c-xiic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,6 @@ static const struct i2c_adapter_quirks xiic_quirks = {
734734

735735
static const struct i2c_adapter xiic_adapter = {
736736
.owner = THIS_MODULE,
737-
.name = DRIVER_NAME,
738737
.class = I2C_CLASS_DEPRECATED,
739738
.algo = &xiic_algorithm,
740739
.quirks = &xiic_quirks,
@@ -771,6 +770,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
771770
i2c_set_adapdata(&i2c->adap, i2c);
772771
i2c->adap.dev.parent = &pdev->dev;
773772
i2c->adap.dev.of_node = pdev->dev.of_node;
773+
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
774+
DRIVER_NAME " %s", pdev->name);
774775

775776
mutex_init(&i2c->lock);
776777

0 commit comments

Comments
 (0)