sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
[safe/jmp/linux-2.6] / include / linux / io-mapping.h
index c1b4830..97eb928 100644 (file)
@@ -51,23 +51,28 @@ io_mapping_create_wc(resource_size_t base, unsigned long size)
        struct io_mapping *iomap;
        pgprot_t prot;
 
-       if (!reserve_io_memtype_wc(base, size, &prot))
-               return NULL;
-
        iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
        if (!iomap)
-               return NULL;
+               goto out_err;
+
+       if (iomap_create_wc(base, size, &prot))
+               goto out_free;
 
        iomap->base = base;
        iomap->size = size;
        iomap->prot = prot;
        return iomap;
+
+out_free:
+       kfree(iomap);
+out_err:
+       return NULL;
 }
 
 static inline void
 io_mapping_free(struct io_mapping *mapping)
 {
-       free_io_memtype(mapping->base, mapping->size);
+       iomap_free(mapping->base, mapping->size);
        kfree(mapping);
 }