]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86: implement mapping_error in pci-nommu_64.c
authorGlauber Costa <gcosta@redhat.com>
Tue, 8 Apr 2008 16:20:45 +0000 (13:20 -0300)
committerIngo Molnar <mingo@elte.hu>
Sat, 19 Apr 2008 17:19:57 +0000 (19:19 +0200)
This patch implements mapping_error for pci-nommu_64.c.
It takes care to keep the same compatible behaviour it already
had. Although this file is not (yet) used for i386, we introduce
the i386 version here. Again, care is taken, even at the expense of
an ifdef, to keep the same behaviour inconditionally.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/pci-nommu_64.c

index 90a7c40aa9894d95ad9417afc555caf857943226..a4e8ccfae4cb0f3c6f2c3a1f1a408596de04c1c8 100644 (file)
@@ -67,9 +67,21 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
        return nents;
 }
 
+/* Make sure we keep the same behaviour */
+static int nommu_mapping_error(dma_addr_t dma_addr)
+{
+#ifdef CONFIG_X86_32
+       return 0;
+#else
+       return (dma_addr == bad_dma_address);
+#endif
+}
+
+
 const struct dma_mapping_ops nommu_dma_ops = {
        .map_single = nommu_map_single,
        .map_sg = nommu_map_sg,
+       .mapping_error = nommu_mapping_error,
        .is_phys = 1,
 };