diff options
author | Lori Hikichi <lori.hikichi@broadcom.com> | 2019-08-08 09:07:53 +0530 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-08-30 14:59:20 +0200 |
commit | 539005ffc6260fcb3bb4171138be5f66a41185a9 (patch) | |
tree | 678605a8bbe71a3b6c9186c641dfa2712fec266f /drivers/i2c | |
parent | 0183eb8bb59d45f26ec4fc73aaa416067fe6c0be (diff) | |
download | blackbird-op-linux-539005ffc6260fcb3bb4171138be5f66a41185a9.tar.gz blackbird-op-linux-539005ffc6260fcb3bb4171138be5f66a41185a9.zip |
i2c: iproc: Add full name of devicetree node to adapter name
Add the full name of the devicetree node to the adapter name.
Without this change, all adapters have the same name making it difficult
to distinguish between multiple instances.
The most obvious way to see this is to use the utility i2c_detect.
e.g. "i2c-detect -l"
Before
i2c-1 i2c Broadcom iProc I2C adapter I2C adapter
i2c-0 i2c Broadcom iProc I2C adapter I2C adapter
After
i2c-1 i2c Broadcom iProc (i2c@e0000) I2C adapter
i2c-0 i2c Broadcom iProc (i2c@b0000) I2C adapter
Now it is easy to figure out which adapter maps to a which DT node.
Signed-off-by: Lori Hikichi <lori.hikichi@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-bcm-iproc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 2c7f145a036e..ee5578173fb1 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -917,7 +917,9 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev) adap = &iproc_i2c->adapter; i2c_set_adapdata(adap, iproc_i2c); - strlcpy(adap->name, "Broadcom iProc I2C adapter", sizeof(adap->name)); + snprintf(adap->name, sizeof(adap->name), + "Broadcom iProc (%s)", + of_node_full_name(iproc_i2c->device->of_node)); adap->algo = &bcm_iproc_algo; adap->quirks = &bcm_iproc_i2c_quirks; adap->dev.parent = &pdev->dev; |