misc: tegra-cec: add /sys/devices/platform symlink

Create a symlink for tegra_cec if it is not under platform bus or
it has been created with different name.

Bug 200214224
Bug 200185815
Bug 1764073

Change-Id: Ib2f89db016982ca916894c37e47bbdf177fb617e
Signed-off-by: Chun XU <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1175137
(cherry picked from commit 506e6370d234c4770afb22372ef1955faa7822cf)
This commit is contained in:
Chun XU
2016-07-04 17:16:44 +08:00
committed by Jon Hunter
parent 3a1bf5d02f
commit 0859614c3d

View File

@@ -536,6 +536,18 @@ static int tegra_cec_probe(struct platform_device *pdev)
goto cec_error;
}
/*
* Create a symlink for tegra_cec if it is not under platform bus or
* it has been created with different name.
*/
if ((pdev->dev.parent != &platform_bus) ||
strcmp(dev_name(&pdev->dev), TEGRA_CEC_NAME)) {
ret = sysfs_create_link(&platform_bus.kobj,
&pdev->dev.kobj, TEGRA_CEC_NAME);
if (ret)
dev_warn(&pdev->dev, "Could not create sysfs link.\n");
}
ret = sysfs_create_file(
&pdev->dev.kobj, &dev_attr_cec_logical_addr_config.attr);
dev_info(&pdev->dev, "cec_add_sysfs ret=%d\n", ret);