blob: 5b57da475065cd1fcd7a3fa2cb30d06be36d5db1 [file] [log] [blame]
Kevin Hilman9c9b1bc2017-01-09 12:55:29 -08001/*
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
15struct pdata_init {
16 const char *compatible;
17 void (*fn)(void);
18};
19
20static 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 break;
27 }
28 quirks++;
29 }
30}
31
32static struct pdata_init pdata_quirks[] __initdata = {
33 { /* sentinel */ },
34};
35
36void __init pdata_quirks_init(void)
37{
38 pdata_quirks_check(pdata_quirks);
39}