i2c: tegra: Use device name for adapter name
authorJon Hunter <jonathanh@nvidia.com>
Fri, 26 Aug 2016 13:09:02 +0000 (14:09 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 30 Aug 2016 19:59:37 +0000 (21:59 +0200)
All Tegra I2C devices have the name "Tegra I2C adapter" which is not
very useful when viewing the I2C adapter names via the sysfs. Therefore,
use the device name, which is unique for each I2C device, instead.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-tegra.c

index e5c8c67a2491b4b61449f1f00378760cd774091a..bdb50258a9a84c59b4c6ac786434e181bfb30392 100644 (file)
@@ -927,7 +927,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
        i2c_set_adapdata(&i2c_dev->adapter, i2c_dev);
        i2c_dev->adapter.owner = THIS_MODULE;
        i2c_dev->adapter.class = I2C_CLASS_DEPRECATED;
-       strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
+       strlcpy(i2c_dev->adapter.name, dev_name(&pdev->dev),
                sizeof(i2c_dev->adapter.name));
        i2c_dev->adapter.dev.parent = &pdev->dev;
        i2c_dev->adapter.nr = pdev->id;
This page took 0.041029 seconds and 5 git commands to generate.