nvdimm_map 65 drivers/nvdimm/core.c static struct nvdimm_map *find_nvdimm_map(struct device *dev, nvdimm_map 69 drivers/nvdimm/core.c struct nvdimm_map *nvdimm_map; nvdimm_map 71 drivers/nvdimm/core.c list_for_each_entry(nvdimm_map, &nvdimm_bus->mapping_list, list) nvdimm_map 72 drivers/nvdimm/core.c if (nvdimm_map->offset == offset) nvdimm_map 73 drivers/nvdimm/core.c return nvdimm_map; nvdimm_map 77 drivers/nvdimm/core.c static struct nvdimm_map *alloc_nvdimm_map(struct device *dev, nvdimm_map 81 drivers/nvdimm/core.c struct nvdimm_map *nvdimm_map; nvdimm_map 83 drivers/nvdimm/core.c nvdimm_map = kzalloc(sizeof(*nvdimm_map), GFP_KERNEL); nvdimm_map 84 drivers/nvdimm/core.c if (!nvdimm_map) nvdimm_map 87 drivers/nvdimm/core.c INIT_LIST_HEAD(&nvdimm_map->list); nvdimm_map 88 drivers/nvdimm/core.c nvdimm_map->nvdimm_bus = nvdimm_bus; nvdimm_map 89 drivers/nvdimm/core.c nvdimm_map->offset = offset; nvdimm_map 90 drivers/nvdimm/core.c nvdimm_map->flags = flags; nvdimm_map 91 drivers/nvdimm/core.c nvdimm_map->size = size; nvdimm_map 92 drivers/nvdimm/core.c kref_init(&nvdimm_map->kref); nvdimm_map 101 drivers/nvdimm/core.c nvdimm_map->mem = memremap(offset, size, flags); nvdimm_map 103 drivers/nvdimm/core.c nvdimm_map->iomem = ioremap(offset, size); nvdimm_map 105 drivers/nvdimm/core.c if (!nvdimm_map->mem) nvdimm_map 110 drivers/nvdimm/core.c list_add(&nvdimm_map->list, &nvdimm_bus->mapping_list); nvdimm_map 112 drivers/nvdimm/core.c return nvdimm_map; nvdimm_map 117 drivers/nvdimm/core.c kfree(nvdimm_map); nvdimm_map 124 drivers/nvdimm/core.c struct nvdimm_map *nvdimm_map; nvdimm_map 126 drivers/nvdimm/core.c nvdimm_map = container_of(kref, struct nvdimm_map, kref); nvdimm_map 127 drivers/nvdimm/core.c nvdimm_bus = nvdimm_map->nvdimm_bus; nvdimm_map 129 drivers/nvdimm/core.c dev_dbg(&nvdimm_bus->dev, "%pa\n", &nvdimm_map->offset); nvdimm_map 130 drivers/nvdimm/core.c list_del(&nvdimm_map->list); nvdimm_map 131 drivers/nvdimm/core.c if (nvdimm_map->flags) nvdimm_map 132 drivers/nvdimm/core.c memunmap(nvdimm_map->mem); nvdimm_map 134 drivers/nvdimm/core.c iounmap(nvdimm_map->iomem); nvdimm_map 135 drivers/nvdimm/core.c release_mem_region(nvdimm_map->offset, nvdimm_map->size); nvdimm_map 136 drivers/nvdimm/core.c kfree(nvdimm_map); nvdimm_map 141 drivers/nvdimm/core.c struct nvdimm_map *nvdimm_map = data; nvdimm_map 142 drivers/nvdimm/core.c struct nvdimm_bus *nvdimm_bus = nvdimm_map->nvdimm_bus; nvdimm_map 145 drivers/nvdimm/core.c kref_put(&nvdimm_map->kref, nvdimm_map_release); nvdimm_map 159 drivers/nvdimm/core.c struct nvdimm_map *nvdimm_map; nvdimm_map 162 drivers/nvdimm/core.c nvdimm_map = find_nvdimm_map(dev, offset); nvdimm_map 163 drivers/nvdimm/core.c if (!nvdimm_map) nvdimm_map 164 drivers/nvdimm/core.c nvdimm_map = alloc_nvdimm_map(dev, offset, size, flags); nvdimm_map 166 drivers/nvdimm/core.c kref_get(&nvdimm_map->kref); nvdimm_map 169 drivers/nvdimm/core.c if (!nvdimm_map) nvdimm_map 172 drivers/nvdimm/core.c if (devm_add_action_or_reset(dev, nvdimm_map_put, nvdimm_map)) nvdimm_map 175 drivers/nvdimm/core.c return nvdimm_map->mem;