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
313313 }
314314
315315
316−void __init vexpress_sysreg_early_init(void __iomem *base)
316+void __init vexpress_sysreg_setup(struct device_node *node)
317317 {
318− struct device_node *node = of_find_compatible_node(NULL, NULL,
319− "arm,vexpress-sysreg");
320−
321− if (node)
322− base = of_iomap(node, 0);
323−
324− if (WARN_ON(!base))
318+ if (WARN_ON(!vexpress_sysreg_base))
325319 return;
326320
327− vexpress_sysreg_base = base;
328−
329321 if (readl(vexpress_sysreg_base + SYS_MISC) & SYS_MISC_MASTERSITE)
330322 vexpress_master_site = VEXPRESS_SITE_DB2;
331323 else
@@ -336,9 +328,23 @@ void __init vexpress_sysreg_early_init(void __iomem *base) · 4 unmodified lines
336328 WARN_ON(!vexpress_sysreg_config_bridge);
337329 }
338330
331+void __init vexpress_sysreg_early_init(void __iomem *base)
332+{
333+ vexpress_sysreg_base = base;
334+ vexpress_sysreg_setup(NULL);
335+}
336+
339337 void __init vexpress_sysreg_of_early_init(void)
340338 {
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+ }
342348 }
343349
344350
@@ -426,9 +432,11 @@ static int vexpress_sysreg_probe(struct platform_device *pdev) · 81 unmodified lines
426432 return -EBUSY;
427433 }
428434
429− if (!vexpress_sysreg_base)
435+ if (!vexpress_sysreg_base) {
430436 vexpress_sysreg_base = devm_ioremap(&pdev->dev, res->start,
431437 resource_size(res));
438+ vexpress_sysreg_setup(pdev->dev.of_node);
439+ }
432440
433441 if (!vexpress_sysreg_base) {
434442 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