aboutsummaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorPekka Paalanen <pq@iki.fi>2008-10-27 21:21:15 +0200
committerPekka Paalanen <pq@iki.fi>2008-10-27 21:21:15 +0200
commit89ef1b5483bb234278fe40e193643fc9777f50d4 (patch)
tree98ae3141db60155ba578f5e877b8f62ebe5ae6f4 /linux-core
parent145d2d610b90b6129bbbebd1e1f8c71f9147cbde (diff)
drm: missing init_mm symbol, compatibility fix
The drm_compat.c version of kmap_atomic_prot_pfn() uses the macro pgd_offset_k(), which references the symbol init_mm. Starting in 2.6.25, init_mm is no longer exported by default. The only user of kmap_atomic_prot_pfn() is i915, so this should not hurt anyone, and it allows people to load drm.ko. Signed-off-by: Pekka Paalanen <pq@iki.fi>
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_compat.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index c7f72e33..e09be479 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -333,9 +333,24 @@ typedef _Bool bool;
#if (defined(CONFIG_X86) && defined(CONFIG_X86_32) && defined(CONFIG_HIGHMEM))
+/*
+ * pgd_offset_k() is a macro that uses the symbol init_mm,
+ * check that it is available.
+ */
+# if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) || \
+ defined(CONFIG_UNUSED_SYMBOLS))
#define DRM_KMAP_ATOMIC_PROT_PFN
extern void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type,
pgprot_t protection);
+# else
+#warning "init_mm is not available on this kernel!"
+static inline void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type,
+ pgprot_t protection)
+{
+ /* stub */
+ return NULL;
+}
+# endif /* no init_mm */
#endif
#if !defined(flush_agp_mappings)