diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2013-09-02 22:37:53 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:57:49 -0400 |
commit | a1b82df461c22f482f2cb9af9b2884af94967b0f (patch) | |
tree | d8ff06377f18c05962ed50994201b59c86b2d638 | |
parent | fcd06e68f55b0d0f9ae04378f4b49e1adf547617 (diff) |
of_mtd: Add no-op stubs to support CONFIG_OF=n
Just like the rest of the subsystems, let's add the required no-op
functions to implement stubs when CONFIG_OF=n.
This prevents MTD drivers from having ugly ifdefs in their code,
and instead hide the ifdef monster in the header closet (far away
from people's sight).
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
-rw-r--r-- | include/linux/of_mtd.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h index ed7f267e6389..6f10e938ff7e 100644 --- a/include/linux/of_mtd.h +++ b/include/linux/of_mtd.h | |||
@@ -10,10 +10,29 @@ | |||
10 | #define __LINUX_OF_NET_H | 10 | #define __LINUX_OF_NET_H |
11 | 11 | ||
12 | #ifdef CONFIG_OF_MTD | 12 | #ifdef CONFIG_OF_MTD |
13 | |||
13 | #include <linux/of.h> | 14 | #include <linux/of.h> |
14 | int of_get_nand_ecc_mode(struct device_node *np); | 15 | int of_get_nand_ecc_mode(struct device_node *np); |
15 | int of_get_nand_bus_width(struct device_node *np); | 16 | int of_get_nand_bus_width(struct device_node *np); |
16 | bool of_get_nand_on_flash_bbt(struct device_node *np); | 17 | bool of_get_nand_on_flash_bbt(struct device_node *np); |
17 | #endif | 18 | |
19 | #else /* CONFIG_OF_MTD */ | ||
20 | |||
21 | static inline int of_get_nand_ecc_mode(struct device_node *np) | ||
22 | { | ||
23 | return -ENOSYS; | ||
24 | } | ||
25 | |||
26 | static inline int of_get_nand_bus_width(struct device_node *np) | ||
27 | { | ||
28 | return -ENOSYS; | ||
29 | } | ||
30 | |||
31 | static inline bool of_get_nand_on_flash_bbt(struct device_node *np) | ||
32 | { | ||
33 | return false; | ||
34 | } | ||
35 | |||
36 | #endif /* CONFIG_OF_MTD */ | ||
18 | 37 | ||
19 | #endif /* __LINUX_OF_MTD_H */ | 38 | #endif /* __LINUX_OF_MTD_H */ |