Commit 11db0486 authored by Dan Williams's avatar Dan Williams Committed by Linus Torvalds

mm: cleanup ifdef guards for vmem_altmap

Now that ZONE_DEVICE depends on SPARSEMEM_VMEMMAP we can simplify some
ifdef guards to just ZONE_DEVICE.

Link: default avatarDan Williams <>
Reported-by: default avatarVlastimil Babka <>
Cc: Eric Sandeen <>
Cc: Jeff Moyer <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent c02b6aec
......@@ -26,7 +26,7 @@ struct vmem_altmap {
unsigned long vmem_altmap_offset(struct vmem_altmap *altmap);
void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns);
struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start);
static inline struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
......@@ -308,12 +308,6 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
if (is_ram == REGION_INTERSECTS)
return __va(res->start);
dev_err(dev, "%s: altmap requires CONFIG_SPARSEMEM_VMEMMAP=y\n",
return ERR_PTR(-ENXIO);
if (!ref)
return ERR_PTR(-EINVAL);
......@@ -401,7 +395,6 @@ void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns)
altmap->alloc -= nr_pfns;
struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
......@@ -427,5 +420,4 @@ struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
return pgmap ? pgmap->altmap : NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment