summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-08-17 17:42:17 +0300
committerThierry Reding <treding@nvidia.com>2017-08-17 17:43:13 +0300
commit27a0342ac162bf2ba30c288cfb7b72eabed38d8b (patch)
tree48f4e7d789054b3dd4235bd89ccb76aad84d398e /arch/arm/mach-tegra/tegra.c
parent0c106e57dea709395b5b5eb004987b7ddad251ad (diff)
downloadlinux-27a0342ac162bf2ba30c288cfb7b72eabed38d8b.tar.xz
soc/tegra: Register SoC device
Move this code from arch/arm/mach-tegra and make it common among 32-bit and 64-bit Tegra SoCs. This is slightly complicated by the fact that on 32-bit Tegra, the SoC device is used as the parent for all devices that are instantiated from device tree. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra.c')
-rw-r--r--arch/arm/mach-tegra/tegra.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 649e9e8c7bcc..02e712d2ea30 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -84,35 +84,8 @@ static void __init tegra_dt_init_irq(void)
static void __init tegra_dt_init(void)
{
- struct soc_device_attribute *soc_dev_attr;
- struct soc_device *soc_dev;
- struct device *parent = NULL;
+ struct device *parent = tegra_soc_device_register();
- soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
- if (!soc_dev_attr)
- goto out;
-
- soc_dev_attr->family = kasprintf(GFP_KERNEL, "Tegra");
- soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d",
- tegra_sku_info.revision);
- soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%u", tegra_get_chip_id());
-
- soc_dev = soc_device_register(soc_dev_attr);
- if (IS_ERR(soc_dev)) {
- kfree(soc_dev_attr->family);
- kfree(soc_dev_attr->revision);
- kfree(soc_dev_attr->soc_id);
- kfree(soc_dev_attr);
- goto out;
- }
-
- parent = soc_device_to_device(soc_dev);
-
- /*
- * Finished with the static registrations now; fill in the missing
- * devices
- */
-out:
of_platform_default_populate(NULL, NULL, parent);
}