diff options
author | Thierry Reding <treding@nvidia.com> | 2017-08-17 16:42:17 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2017-08-17 16:43:13 +0200 |
commit | 27a0342ac162bf2ba30c288cfb7b72eabed38d8b (patch) | |
tree | 48f4e7d789054b3dd4235bd89ccb76aad84d398e /arch/arm/mach-tegra | |
parent | 0c106e57dea709395b5b5eb004987b7ddad251ad (diff) | |
download | linux-27a0342ac162bf2ba30c288cfb7b72eabed38d8b.tar.gz linux-27a0342ac162bf2ba30c288cfb7b72eabed38d8b.tar.bz2 linux-27a0342ac162bf2ba30c288cfb7b72eabed38d8b.zip |
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')
-rw-r--r-- | arch/arm/mach-tegra/tegra.c | 29 |
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); } |