diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-09-05 14:29:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-05 14:57:19 -0400 |
commit | 7c304d7e24fd4996a2b219312f739c4406b8e2e3 (patch) | |
tree | 6f513d00e0bda25b934baf0e3ee36b83ecaa2d04 /drivers | |
parent | e6b42eb6a66c188642aeb447312938c6f6ebee86 (diff) |
memory: fix build when CONFIG_OF && !CONFIG_DDR
Commit e6b42eb "memory: emif: add device tree support to emif driver"
added drivers/memory/of_memory.c, which references tables defined in
lib/jedec_ddr_data.c. of_memory.c is compiled when CONFIG_OF, whereas
jedec_ddr_data.c is compiled when CONFIG_DDR. This breaks the build
when CONFIG_OF is defined but not CONFIG_DDR:
drivers/built-in.o: In function `of_get_ddr_timings':
drivers/memory/of_memory.c:138: undefined reference to `lpddr2_jedec_timings'
drivers/built-in.o: In function `of_get_min_tck':
drivers/memory/of_memory.c:62: undefined reference to `lpddr2_jedec_min_tck'
make: *** [vmlinux] Error 1
To solve this, only compile of_memory.c when CONFIG_OF && CONFIG_DDR,
otherwise, stub out the functions.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/memory/Makefile | 2 | ||||
-rw-r--r-- | drivers/memory/of_memory.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile index cd8486b51f74..9cce5d70ed52 100644 --- a/drivers/memory/Makefile +++ b/drivers/memory/Makefile | |||
@@ -2,7 +2,9 @@ | |||
2 | # Makefile for memory devices | 2 | # Makefile for memory devices |
3 | # | 3 | # |
4 | 4 | ||
5 | ifeq ($(CONFIG_DDR),y) | ||
5 | obj-$(CONFIG_OF) += of_memory.o | 6 | obj-$(CONFIG_OF) += of_memory.o |
7 | endif | ||
6 | obj-$(CONFIG_TI_EMIF) += emif.o | 8 | obj-$(CONFIG_TI_EMIF) += emif.o |
7 | obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o | 9 | obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o |
8 | obj-$(CONFIG_TEGRA30_MC) += tegra30-mc.o | 10 | obj-$(CONFIG_TEGRA30_MC) += tegra30-mc.o |
diff --git a/drivers/memory/of_memory.h b/drivers/memory/of_memory.h index 20b496efed65..ef2514f553d3 100644 --- a/drivers/memory/of_memory.h +++ b/drivers/memory/of_memory.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #ifndef __LINUX_MEMORY_OF_REG_H | 12 | #ifndef __LINUX_MEMORY_OF_REG_H |
13 | #define __LINUX_MEMORY_OF_REG_H | 13 | #define __LINUX_MEMORY_OF_REG_H |
14 | 14 | ||
15 | #ifdef CONFIG_OF | 15 | #if defined(CONFIG_OF) && defined(CONFIG_DDR) |
16 | extern const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np, | 16 | extern const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np, |
17 | struct device *dev); | 17 | struct device *dev); |
18 | extern const struct lpddr2_timings | 18 | extern const struct lpddr2_timings |
@@ -31,6 +31,6 @@ static inline const struct lpddr2_timings | |||
31 | { | 31 | { |
32 | return NULL; | 32 | return NULL; |
33 | } | 33 | } |
34 | #endif /* CONFIG_OF */ | 34 | #endif /* CONFIG_OF && CONFIG_DDR */ |
35 | 35 | ||
36 | #endif /* __LINUX_MEMORY_OF_REG_ */ | 36 | #endif /* __LINUX_MEMORY_OF_REG_ */ |