Kevin Hilman | 9c9b1bc | 2017-01-09 12:55:29 -0800 | [diff] [blame^] | 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 | break; |
| 27 | } |
| 28 | quirks++; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | static struct pdata_init pdata_quirks[] __initdata = { |
| 33 | { /* sentinel */ }, |
| 34 | }; |
| 35 | |
| 36 | void __init pdata_quirks_init(void) |
| 37 | { |
| 38 | pdata_quirks_check(pdata_quirks); |
| 39 | } |