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 e5c8c67..bdb5025 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;