Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

soc/tegra: fuse: Refactor resource mapping

To prepare for adding ACPI support to the tegra-apbmisc driver,
relocate the code responsible for mapping memory resources from
the function ‘tegra_init_apbmisc’ to the function
‘tegra_init_apbmisc_resources.’ This adjustment will allow the
code to be shared between ‘tegra_init_apbmisc’ and the upcoming
‘tegra_acpi_init_apbmisc’ function.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Kartik and committed by
Thierry Reding
f0139d66 4569e604

+21 -16
+21 -16
drivers/soc/tegra/fuse/tegra-apbmisc.c
··· 160 160 tegra_sku_info.platform = tegra_get_platform(); 161 161 } 162 162 163 - void __init tegra_init_apbmisc(void) 163 + static void tegra_init_apbmisc_resources(struct resource *apbmisc, 164 + struct resource *straps) 164 165 { 165 166 void __iomem *strapping_base; 167 + 168 + apbmisc_base = ioremap(apbmisc->start, resource_size(apbmisc)); 169 + if (apbmisc_base) 170 + chipid = readl_relaxed(apbmisc_base + 4); 171 + else 172 + pr_err("failed to map APBMISC registers\n"); 173 + 174 + strapping_base = ioremap(straps->start, resource_size(straps)); 175 + if (strapping_base) { 176 + strapping = readl_relaxed(strapping_base); 177 + iounmap(strapping_base); 178 + } else { 179 + pr_err("failed to map strapping options registers\n"); 180 + } 181 + } 182 + 183 + void __init tegra_init_apbmisc(void) 184 + { 166 185 struct resource apbmisc, straps; 167 186 struct device_node *np; 168 187 ··· 238 219 } 239 220 } 240 221 241 - apbmisc_base = ioremap(apbmisc.start, resource_size(&apbmisc)); 242 - if (!apbmisc_base) { 243 - pr_err("failed to map APBMISC registers\n"); 244 - } else { 245 - chipid = readl_relaxed(apbmisc_base + 4); 246 - } 247 - 248 - strapping_base = ioremap(straps.start, resource_size(&straps)); 249 - if (!strapping_base) { 250 - pr_err("failed to map strapping options registers\n"); 251 - } else { 252 - strapping = readl_relaxed(strapping_base); 253 - iounmap(strapping_base); 254 - } 255 - 222 + tegra_init_apbmisc_resources(&apbmisc, &straps); 256 223 long_ram_code = of_property_read_bool(np, "nvidia,long-ram-code"); 257 224 258 225 put: