4 #include <linux/export.h>
11 static int devm_ioremap_match(
struct device *
dev,
void *
res,
void *match_data)
13 return *(
void **)res == match_data;
113 dev_err(dev,
"invalid resource\n");
117 size = resource_size(res);
118 name = res->
name ?: dev_name(dev);
121 dev_err(dev,
"can't request region for resource %pR\n", res);
131 dev_err(dev,
"ioremap failed for resource %pR\n", res);
139 #ifdef CONFIG_HAS_IOPORT
143 static void devm_ioport_map_release(
struct device *
dev,
void *
res)
148 static int devm_ioport_map_match(
struct device *dev,
void *res,
151 return *(
void **)res == match_data;
191 void devm_ioport_unmap(
struct device *dev,
void __iomem *addr)
195 devm_ioport_map_match, (
void *)addr));
203 #define PCIM_IOMAP_MAX PCI_ROM_RESOURCE
205 struct pcim_iomap_devres {
209 static void pcim_iomap_release(
struct device *gendev,
void *res)
212 struct pcim_iomap_devres *
this =
res;
215 for (i = 0; i < PCIM_IOMAP_MAX; i++)
235 struct pcim_iomap_devres *dr, *new_dr;
262 BUG_ON(bar >= PCIM_IOMAP_MAX);
265 if (!tbl || tbl[bar])
268 tbl[bar] = pci_iomap(pdev, bar, maxlen);
290 for (i = 0; i < PCIM_IOMAP_MAX; i++)
291 if (tbl[i] == addr) {
319 if (!(mask & (1 << i)))
342 if (!(mask & (1 << i)))
363 int request_mask = ((1 << 6) - 1) & ~mask;
394 if (!(mask & (1 << i)))