History

mfd: vexpress-sysreg: Don't skip initialization on probe

The vexpress-sysreg driver does not have to be initialized early, when the platform doesn't require this. Unfortunately in such case it wasn't initialized correctly - master site lookup and config bridge registration were missing. Fixed now.

Pawel Moll committed 13 years ago

Commit 52666291 parent ab838bc1 file · +20 −12Browse files

Unified · Split

drivers/mfd/vexpress-sysreg.c+20−12
@@ -313,19 +313,11 @@ static void vexpress_sysreg_config_complete(unsigned long data) · 312 unmodified lines
313}313}
314 314
315 315
316void __init vexpress_sysreg_early_init(void __iomem *base)316void __init vexpress_sysreg_setup(struct device_node *node)
317{317{
318 struct device_node *node = of_find_compatible_node(NULL, NULL,318 if (WARN_ON(!vexpress_sysreg_base))
319 "arm,vexpress-sysreg");
320
321 if (node)
322 base = of_iomap(node, 0);
323
324 if (WARN_ON(!base))
325 return;319 return;
326 320
327 vexpress_sysreg_base = base;
328
329 if (readl(vexpress_sysreg_base + SYS_MISC) & SYS_MISC_MASTERSITE)321 if (readl(vexpress_sysreg_base + SYS_MISC) & SYS_MISC_MASTERSITE)
330 vexpress_master_site = VEXPRESS_SITE_DB2;322 vexpress_master_site = VEXPRESS_SITE_DB2;
331 else323 else
@@ -336,9 +328,23 @@ void __init vexpress_sysreg_early_init(void __iomem *base) · 4 unmodified lines
336 WARN_ON(!vexpress_sysreg_config_bridge);328 WARN_ON(!vexpress_sysreg_config_bridge);
337}329}
338 330
331void __init vexpress_sysreg_early_init(void __iomem *base)
332{
333 vexpress_sysreg_base = base;
334 vexpress_sysreg_setup(NULL);
335}
336
339void __init vexpress_sysreg_of_early_init(void)337void __init vexpress_sysreg_of_early_init(void)
340{338{
341 vexpress_sysreg_early_init(NULL);339 struct device_node *node = of_find_compatible_node(NULL, NULL,
340 "arm,vexpress-sysreg");
341
342 if (node) {
343 vexpress_sysreg_base = of_iomap(node, 0);
344 vexpress_sysreg_setup(node);
345 } else {
346 pr_info("vexpress-sysreg: No Device Tree node found.");
347 }
342}348}
343 349
344 350
@@ -426,9 +432,11 @@ static int vexpress_sysreg_probe(struct platform_device *pdev) · 81 unmodified lines
426 return -EBUSY;432 return -EBUSY;
427 }433 }
428 434
429 if (!vexpress_sysreg_base)435 if (!vexpress_sysreg_base) {
430 vexpress_sysreg_base = devm_ioremap(&pdev->dev, res->start,436 vexpress_sysreg_base = devm_ioremap(&pdev->dev, res->start,
431 resource_size(res));437 resource_size(res));
438 vexpress_sysreg_setup(pdev->dev.of_node);
439 }
432 440
433 if (!vexpress_sysreg_base) {441 if (!vexpress_sysreg_base) {
434 dev_err(&pdev->dev, "Failed to obtain base address!\n");442 dev_err(&pdev->dev, "Failed to obtain base address!\n");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t