1 /*
2  * Legacy platform_data quirks
3  *
4  * Copyright (C) 2016 BayLibre, Inc
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 #include <linux/kernel.h>
11 #include <linux/of_platform.h>
12 
13 #include <mach/common.h>
14 
15 struct pdata_init {
16 	const char *compatible;
17 	void (*fn)(void);
18 };
19 
20 static void pdata_quirks_check(struct pdata_init *quirks)
21 {
22 	while (quirks->compatible) {
23 		if (of_machine_is_compatible(quirks->compatible)) {
24 			if (quirks->fn)
25 				quirks->fn();
26 		}
27 		quirks++;
28 	}
29 }
30 
31 static struct pdata_init pdata_quirks[] __initdata = {
32 	{ /* sentinel */ },
33 };
34 
35 void __init pdata_quirks_init(void)
36 {
37 	pdata_quirks_check(pdata_quirks);
38 }
39