mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-11-27 06:01:12 +00:00
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing. Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
140a1ef2f9
commit
28f65c11f2
@ -193,7 +193,7 @@ static int __devinit scoop_probe(struct platform_device *pdev)
|
||||
spin_lock_init(&devptr->scoop_lock);
|
||||
|
||||
inf = pdev->dev.platform_data;
|
||||
devptr->base = ioremap(mem->start, mem->end - mem->start + 1);
|
||||
devptr->base = ioremap(mem->start, resource_size(mem));
|
||||
|
||||
if (!devptr->base) {
|
||||
ret = -ENOMEM;
|
||||
|
@ -525,7 +525,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
|
||||
if (ARRAY_SIZE(lcdc_resources) > 2) {
|
||||
void __iomem *fb;
|
||||
struct resource *fb_res = &lcdc_resources[2];
|
||||
size_t fb_len = fb_res->end - fb_res->start + 1;
|
||||
size_t fb_len = resource_size(fb_res);
|
||||
|
||||
fb = ioremap(fb_res->start, fb_len);
|
||||
if (fb) {
|
||||
|
@ -129,12 +129,12 @@ static void __init mv78xx0_pcie_preinit(void)
|
||||
struct pcie_port *pp = pcie_port + i;
|
||||
|
||||
mv78xx0_setup_pcie_io_win(win++, pp->res[0].start,
|
||||
pp->res[0].end - pp->res[0].start + 1,
|
||||
pp->maj, pp->min);
|
||||
resource_size(&pp->res[0]),
|
||||
pp->maj, pp->min);
|
||||
|
||||
mv78xx0_setup_pcie_mem_win(win++, pp->res[1].start,
|
||||
pp->res[1].end - pp->res[1].start + 1,
|
||||
pp->maj, pp->min);
|
||||
resource_size(&pp->res[1]),
|
||||
pp->maj, pp->min);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1791,7 +1791,7 @@ static void __init u300_assign_physmem(void)
|
||||
0 == res->start) {
|
||||
res->start = curr_start;
|
||||
res->end += curr_start;
|
||||
curr_start += (res->end - res->start + 1);
|
||||
curr_start += resource_size(res);
|
||||
|
||||
printk(KERN_INFO "core.c: Mapping RAM " \
|
||||
"%#x-%#x to device %s:%s\n",
|
||||
|
@ -214,14 +214,14 @@ static int __devinit mxc_pwm_probe(struct platform_device *pdev)
|
||||
goto err_free_clk;
|
||||
}
|
||||
|
||||
r = request_mem_region(r->start, r->end - r->start + 1, pdev->name);
|
||||
r = request_mem_region(r->start, resource_size(r), pdev->name);
|
||||
if (r == NULL) {
|
||||
dev_err(&pdev->dev, "failed to request memory resource\n");
|
||||
ret = -EBUSY;
|
||||
goto err_free_clk;
|
||||
}
|
||||
|
||||
pwm->mmio_base = ioremap(r->start, r->end - r->start + 1);
|
||||
pwm->mmio_base = ioremap(r->start, resource_size(r));
|
||||
if (pwm->mmio_base == NULL) {
|
||||
dev_err(&pdev->dev, "failed to ioremap() registers\n");
|
||||
ret = -ENODEV;
|
||||
@ -236,7 +236,7 @@ static int __devinit mxc_pwm_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
err_free_mem:
|
||||
release_mem_region(r->start, r->end - r->start + 1);
|
||||
release_mem_region(r->start, resource_size(r));
|
||||
err_free_clk:
|
||||
clk_put(pwm->clk);
|
||||
err_free:
|
||||
@ -260,7 +260,7 @@ static int __devexit mxc_pwm_remove(struct platform_device *pdev)
|
||||
iounmap(pwm->mmio_base);
|
||||
|
||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
release_mem_region(r->start, r->end - r->start + 1);
|
||||
release_mem_region(r->start, resource_size(r));
|
||||
|
||||
clk_put(pwm->clk);
|
||||
|
||||
|
@ -232,8 +232,8 @@ static int s5p_sysmmu_probe(struct platform_device *pdev)
|
||||
goto err_res;
|
||||
}
|
||||
|
||||
mem = request_mem_region(res->start,
|
||||
((res->end) - (res->start)) + 1, pdev->name);
|
||||
mem = request_mem_region(res->start, resource_size(res),
|
||||
pdev->name);
|
||||
if (!mem) {
|
||||
dev_err(dev, "Failed to request the memory region of %s.\n",
|
||||
sysmmu_ips_name[i]);
|
||||
@ -241,7 +241,7 @@ static int s5p_sysmmu_probe(struct platform_device *pdev)
|
||||
goto err_res;
|
||||
}
|
||||
|
||||
sysmmusfrs[i] = ioremap(res->start, res->end - res->start + 1);
|
||||
sysmmusfrs[i] = ioremap(res->start, resource_size(res));
|
||||
if (!sysmmusfrs[i]) {
|
||||
dev_err(dev, "Failed to ioremap() for %s.\n",
|
||||
sysmmu_ips_name[i]);
|
||||
|
@ -72,7 +72,7 @@ static void s3c_pm_run_sysram(run_fn_t fn, u32 *arg)
|
||||
|
||||
static u32 *s3c_pm_countram(struct resource *res, u32 *val)
|
||||
{
|
||||
u32 size = (u32)(res->end - res->start)+1;
|
||||
u32 size = (u32)resource_size(res);
|
||||
|
||||
size += CHECK_CHUNKSIZE-1;
|
||||
size /= CHECK_CHUNKSIZE;
|
||||
|
@ -444,7 +444,7 @@ static unsigned long __init
|
||||
find_bootmap_pfn(const struct resource *mem)
|
||||
{
|
||||
unsigned long bootmap_pages, bootmap_len;
|
||||
unsigned long node_pages = PFN_UP(mem->end - mem->start + 1);
|
||||
unsigned long node_pages = PFN_UP(resource_size(mem));
|
||||
unsigned long bootmap_start;
|
||||
|
||||
bootmap_pages = bootmem_bootmap_pages(node_pages);
|
||||
@ -541,10 +541,10 @@ static void __init setup_bootmem(void)
|
||||
*/
|
||||
if (res->start >= PFN_PHYS(first_pfn)
|
||||
&& res->end < PFN_PHYS(max_pfn))
|
||||
reserve_bootmem_node(
|
||||
NODE_DATA(node), res->start,
|
||||
res->end - res->start + 1,
|
||||
BOOTMEM_DEFAULT);
|
||||
reserve_bootmem_node(NODE_DATA(node),
|
||||
res->start,
|
||||
resource_size(res),
|
||||
BOOTMEM_DEFAULT);
|
||||
}
|
||||
|
||||
node_set_online(node);
|
||||
|
@ -204,7 +204,7 @@ static int __init eic_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
eic->first_irq = EIM_IRQ_BASE + 32 * pdev->id;
|
||||
eic->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
eic->regs = ioremap(regs->start, resource_size(regs));
|
||||
if (!eic->regs) {
|
||||
dev_dbg(&pdev->dev, "failed to map regs\n");
|
||||
goto err_ioremap;
|
||||
|
@ -245,7 +245,7 @@ static int hsmc_probe(struct platform_device *pdev)
|
||||
|
||||
hsmc->pclk = pclk;
|
||||
hsmc->mck = mck;
|
||||
hsmc->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
hsmc->regs = ioremap(regs->start, resource_size(regs));
|
||||
if (!hsmc->regs)
|
||||
goto out_disable_clocks;
|
||||
|
||||
|
@ -107,7 +107,7 @@ void __init init_IRQ(void)
|
||||
|
||||
clk_enable(pclk);
|
||||
|
||||
intc0.regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
intc0.regs = ioremap(regs->start, resource_size(regs));
|
||||
if (!intc0.regs) {
|
||||
printk(KERN_EMERG "intc: failed to map registers (0x%08lx)\n",
|
||||
(unsigned long)regs->start);
|
||||
|
@ -461,7 +461,7 @@ void __init at32_init_pio(struct platform_device *pdev)
|
||||
clk_enable(pio->clk);
|
||||
|
||||
pio->pdev = pdev;
|
||||
pio->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
pio->regs = ioremap(regs->start, resource_size(regs));
|
||||
|
||||
/* start with irqs disabled and acked */
|
||||
pio_writel(pio, IDR, ~0UL);
|
||||
|
@ -89,7 +89,7 @@ void pcibios_free_controller(struct pci_controller *phb)
|
||||
|
||||
static resource_size_t pcibios_io_size(const struct pci_controller *hose)
|
||||
{
|
||||
return hose->io_resource.end - hose->io_resource.start + 1;
|
||||
return resource_size(&hose->io_resource);
|
||||
}
|
||||
|
||||
int pcibios_vaddr_is_ioport(void __iomem *address)
|
||||
|
@ -215,7 +215,7 @@ static int __init rc32434_pci_init(void)
|
||||
rc32434_pcibridge_init();
|
||||
|
||||
io_map_base = ioremap(rc32434_res_pci_io1.start,
|
||||
rc32434_res_pci_io1.end - rc32434_res_pci_io1.start + 1);
|
||||
resource_size(&rcrc32434_res_pci_io1));
|
||||
|
||||
if (!io_map_base)
|
||||
return -ENOMEM;
|
||||
|
@ -305,7 +305,7 @@ static int __init vr41xx_pciu_init(void)
|
||||
struct resource *res = vr41xx_pci_controller.io_resource;
|
||||
master = setup->master_io;
|
||||
io_map_base = ioremap(master->bus_base_address,
|
||||
res->end - res->start + 1);
|
||||
resource_size(res));
|
||||
if (!io_map_base)
|
||||
return -EBUSY;
|
||||
|
||||
|
@ -394,23 +394,21 @@ void __init platform_alloc_bootmem(void)
|
||||
|
||||
/* Loop through looking for resources that want a particular address */
|
||||
for (i = 0; gp_resources[i].flags != 0; i++) {
|
||||
int size = gp_resources[i].end - gp_resources[i].start + 1;
|
||||
int size = resource_size(&gp_resources[i]);
|
||||
if ((gp_resources[i].start != 0) &&
|
||||
((gp_resources[i].flags & IORESOURCE_MEM) != 0)) {
|
||||
reserve_bootmem(dma_to_phys(gp_resources[i].start),
|
||||
size, 0);
|
||||
total += gp_resources[i].end -
|
||||
gp_resources[i].start + 1;
|
||||
total += resource_size(&gp_resources[i]);
|
||||
pr_info("reserve resource %s at %08x (%u bytes)\n",
|
||||
gp_resources[i].name, gp_resources[i].start,
|
||||
gp_resources[i].end -
|
||||
gp_resources[i].start + 1);
|
||||
resource_size(&gp_resources[i]));
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop through assigning addresses for those that are left */
|
||||
for (i = 0; gp_resources[i].flags != 0; i++) {
|
||||
int size = gp_resources[i].end - gp_resources[i].start + 1;
|
||||
int size = resource_size(&gp_resources[i]);
|
||||
if ((gp_resources[i].start == 0) &&
|
||||
((gp_resources[i].flags & IORESOURCE_MEM) != 0)) {
|
||||
void *mem = alloc_bootmem_pages(size);
|
||||
|
@ -76,7 +76,7 @@ static inline unsigned long macio_resource_len(struct macio_dev *dev, int resour
|
||||
struct resource *res = &dev->resource[resource_no];
|
||||
if (res->start == 0 || res->end == 0 || res->end < res->start)
|
||||
return 0;
|
||||
return res->end - res->start + 1;
|
||||
return resource_size(res);
|
||||
}
|
||||
|
||||
extern int macio_enable_devres(struct macio_dev *dev);
|
||||
|
@ -126,7 +126,7 @@ void __init reserve_crashkernel(void)
|
||||
/* We might have got these values via the command line or the
|
||||
* device tree, either way sanitise them now. */
|
||||
|
||||
crash_size = crashk_res.end - crashk_res.start + 1;
|
||||
crash_size = resource_size(&crashk_res);
|
||||
|
||||
#ifndef CONFIG_RELOCATABLE
|
||||
if (crashk_res.start != KDUMP_KERNELBASE)
|
||||
@ -222,7 +222,7 @@ static void __init export_crashk_values(struct device_node *node)
|
||||
|
||||
if (crashk_res.start != 0) {
|
||||
prom_add_property(node, &crashk_base_prop);
|
||||
crashk_size = crashk_res.end - crashk_res.start + 1;
|
||||
crashk_size = resource_size(&crashk_res);
|
||||
prom_add_property(node, &crashk_size_prop);
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ static resource_size_t pcibios_io_size(const struct pci_controller *hose)
|
||||
#ifdef CONFIG_PPC64
|
||||
return hose->pci_io_size;
|
||||
#else
|
||||
return hose->io_resource.end - hose->io_resource.start + 1;
|
||||
return resource_size(&hose->io_resource);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ mpc52xx_pci_setup(struct pci_controller *hose,
|
||||
(unsigned long long)res->flags);
|
||||
out_be32(&pci_regs->iw0btar,
|
||||
MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start,
|
||||
res->end - res->start + 1));
|
||||
resource_size(res)));
|
||||
iwcr0 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM;
|
||||
if (res->flags & IORESOURCE_PREFETCH)
|
||||
iwcr0 |= MPC52xx_PCI_IWCR_READ_MULTI;
|
||||
@ -278,7 +278,7 @@ mpc52xx_pci_setup(struct pci_controller *hose,
|
||||
res->start, res->end, res->flags);
|
||||
out_be32(&pci_regs->iw1btar,
|
||||
MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start,
|
||||
res->end - res->start + 1));
|
||||
resource_size(res)));
|
||||
iwcr1 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM;
|
||||
if (res->flags & IORESOURCE_PREFETCH)
|
||||
iwcr1 |= MPC52xx_PCI_IWCR_READ_MULTI;
|
||||
@ -300,7 +300,7 @@ mpc52xx_pci_setup(struct pci_controller *hose,
|
||||
out_be32(&pci_regs->iw2btar,
|
||||
MPC52xx_PCI_IWBTAR_TRANSLATION(hose->io_base_phys,
|
||||
res->start,
|
||||
res->end - res->start + 1));
|
||||
resource_size(res)));
|
||||
iwcr2 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_IO;
|
||||
|
||||
/* Set all the IWCR fields at once; they're in the same reg */
|
||||
@ -402,7 +402,7 @@ mpc52xx_add_bridge(struct device_node *node)
|
||||
|
||||
hose->ops = &mpc52xx_pci_ops;
|
||||
|
||||
pci_regs = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
|
||||
pci_regs = ioremap(rsrc.start, resource_size(&rsrc));
|
||||
if (!pci_regs)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -101,7 +101,7 @@ static void __init mpc83xx_km_setup_arch(void)
|
||||
__func__);
|
||||
return;
|
||||
}
|
||||
base = ioremap(res.start, res.end - res.start + 1);
|
||||
base = ioremap(res.start, resource_size(&res));
|
||||
|
||||
/*
|
||||
* IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2)
|
||||
|
@ -68,7 +68,7 @@ static void __init mpc832x_sys_setup_arch(void)
|
||||
struct resource res;
|
||||
|
||||
of_address_to_resource(np, 0, &res);
|
||||
bcsr_regs = ioremap(res.start, res.end - res.start +1);
|
||||
bcsr_regs = ioremap(res.start, resource_size(&res));
|
||||
of_node_put(np);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ static int mpc834xemds_usb_cfg(void)
|
||||
struct resource res;
|
||||
|
||||
of_address_to_resource(np, 0, &res);
|
||||
bcsr_regs = ioremap(res.start, res.end - res.start + 1);
|
||||
bcsr_regs = ioremap(res.start, resource_size(&res));
|
||||
of_node_put(np);
|
||||
}
|
||||
if (!bcsr_regs)
|
||||
|
@ -76,7 +76,7 @@ static void __init mpc836x_mds_setup_arch(void)
|
||||
struct resource res;
|
||||
|
||||
of_address_to_resource(np, 0, &res);
|
||||
bcsr_regs = ioremap(res.start, res.end - res.start +1);
|
||||
bcsr_regs = ioremap(res.start, resource_size(&res));
|
||||
of_node_put(np);
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ int mpc831x_usb_cfg(void)
|
||||
of_node_put(np);
|
||||
return ret;
|
||||
}
|
||||
usb_regs = ioremap(res.start, res.end - res.start + 1);
|
||||
usb_regs = ioremap(res.start, resource_size(&res));
|
||||
|
||||
/* Using on-chip PHY */
|
||||
if (prop && (!strcmp(prop, "utmi_wide") ||
|
||||
|
@ -285,7 +285,7 @@ static int __init sbc8560_bdrstcr_init(void)
|
||||
|
||||
printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start);
|
||||
|
||||
brstcr = ioremap(res.start, res.end - res.start);
|
||||
brstcr = ioremap(res.start, resource_size(&res));
|
||||
if(!brstcr)
|
||||
printk(KERN_WARNING "sbc8560: ioremap of brstcr failed.\n");
|
||||
|
||||
|
@ -123,7 +123,7 @@ static void xes_mpc85xx_fixups(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
l2_base = ioremap(r[0].start, r[0].end - r[0].start + 1);
|
||||
l2_base = ioremap(r[0].start, resource_size(&r[0]));
|
||||
|
||||
xes_mpc85xx_configure_l2(l2_base);
|
||||
}
|
||||
|
@ -393,19 +393,19 @@ static int __init celleb_setup_epci(struct device_node *node,
|
||||
|
||||
if (of_address_to_resource(node, 0, &r))
|
||||
goto error;
|
||||
hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1));
|
||||
hose->cfg_addr = ioremap(r.start, resource_size(&r));
|
||||
if (!hose->cfg_addr)
|
||||
goto error;
|
||||
pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n",
|
||||
r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1));
|
||||
r.start, (unsigned long)hose->cfg_addr, resource_size(&r));
|
||||
|
||||
if (of_address_to_resource(node, 2, &r))
|
||||
goto error;
|
||||
hose->cfg_data = ioremap(r.start, (r.end - r.start + 1));
|
||||
hose->cfg_data = ioremap(r.start, resource_size(&r));
|
||||
if (!hose->cfg_data)
|
||||
goto error;
|
||||
pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n",
|
||||
r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1));
|
||||
r.start, (unsigned long)hose->cfg_data, resource_size(&r));
|
||||
|
||||
hose->ops = &celleb_epci_ops;
|
||||
celleb_epci_init(hose);
|
||||
|
@ -494,7 +494,7 @@ static __init int celleb_setup_pciex(struct device_node *node,
|
||||
pr_err("PCIEXC:Failed to get config resource.\n");
|
||||
return 1;
|
||||
}
|
||||
phb->cfg_addr = ioremap(r.start, r.end - r.start + 1);
|
||||
phb->cfg_addr = ioremap(r.start, resource_size(&r));
|
||||
if (!phb->cfg_addr) {
|
||||
pr_err("PCIEXC:Failed to remap SMMIO region.\n");
|
||||
return 1;
|
||||
|
@ -222,7 +222,7 @@ static int spu_map_resource(struct spu *spu, int nr,
|
||||
return ret;
|
||||
if (phys)
|
||||
*phys = resource.start;
|
||||
len = resource.end - resource.start + 1;
|
||||
len = resource_size(&resource);
|
||||
*virt = ioremap(resource.start, len);
|
||||
if (!*virt)
|
||||
return -EINVAL;
|
||||
|
@ -142,7 +142,7 @@ hydra_init(void)
|
||||
return 0;
|
||||
}
|
||||
of_node_put(np);
|
||||
Hydra = ioremap(r.start, r.end-r.start);
|
||||
Hydra = ioremap(r.start, resource_size(&r));
|
||||
printk("Hydra Mac I/O at %llx\n", (unsigned long long)r.start);
|
||||
printk("Hydra Feature_Control was %x",
|
||||
in_le32(&Hydra->Feature_Control));
|
||||
|
@ -576,7 +576,7 @@ int pasemi_dma_init(void)
|
||||
res.start = 0xfd800000;
|
||||
res.end = res.start + 0x1000;
|
||||
}
|
||||
dma_status = __ioremap(res.start, res.end-res.start, 0);
|
||||
dma_status = __ioremap(res.start, resource_size(&res), 0);
|
||||
pci_dev_put(iob_pdev);
|
||||
|
||||
for (i = 0; i < MAX_TXCH; i++)
|
||||
|
@ -580,10 +580,10 @@ int __init pmac_nvram_init(void)
|
||||
/* Try to obtain an address */
|
||||
if (of_address_to_resource(dp, 0, &r1) == 0) {
|
||||
nvram_naddrs = 1;
|
||||
s1 = (r1.end - r1.start) + 1;
|
||||
s1 = resource_size(&r1);
|
||||
if (of_address_to_resource(dp, 1, &r2) == 0) {
|
||||
nvram_naddrs = 2;
|
||||
s2 = (r2.end - r2.start) + 1;
|
||||
s2 = resource_size(&r2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -838,8 +838,7 @@ static void __init setup_u3_ht(struct pci_controller* hose)
|
||||
* into cfg_addr
|
||||
*/
|
||||
hose->cfg_data = ioremap(cfg_res.start, 0x02000000);
|
||||
hose->cfg_addr = ioremap(self_res.start,
|
||||
self_res.end - self_res.start + 1);
|
||||
hose->cfg_addr = ioremap(self_res.start, resource_size(&self_res));
|
||||
|
||||
/*
|
||||
* /ht node doesn't expose a "ranges" property, we read the register
|
||||
@ -1323,8 +1322,7 @@ static void fixup_u4_pcie(struct pci_dev* dev)
|
||||
*/
|
||||
if (r->start >= 0xf0000000 && r->start < 0xf3000000)
|
||||
continue;
|
||||
if (!region || (r->end - r->start) >
|
||||
(region->end - region->start))
|
||||
if (!region || resource_size(r) > resource_size(region))
|
||||
region = r;
|
||||
}
|
||||
/* Nothing found, bail */
|
||||
|
@ -274,7 +274,7 @@ int __init via_calibrate_decr(void)
|
||||
return 0;
|
||||
}
|
||||
of_node_put(vias);
|
||||
via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
|
||||
via = ioremap(rsrc.start, resource_size(&rsrc));
|
||||
if (via == NULL) {
|
||||
printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
|
||||
return 0;
|
||||
|
@ -203,7 +203,7 @@ static int axon_ram_probe(struct platform_device *device)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
bank->size = resource.end - resource.start + 1;
|
||||
bank->size = resource_size(&resource);
|
||||
|
||||
if (bank->size == 0) {
|
||||
dev_err(&device->dev, "No DDR2 memory found for %s%d\n",
|
||||
|
@ -148,7 +148,7 @@ unsigned int cpm_pic_init(void)
|
||||
if (ret)
|
||||
goto end;
|
||||
|
||||
cpic_reg = ioremap(res.start, res.end - res.start + 1);
|
||||
cpic_reg = ioremap(res.start, resource_size(&res));
|
||||
if (cpic_reg == NULL)
|
||||
goto end;
|
||||
|
||||
|
@ -115,7 +115,7 @@ int cpm_muram_init(void)
|
||||
max = r.end;
|
||||
|
||||
rh_attach_region(&cpm_muram_info, r.start - muram_pbase,
|
||||
r.end - r.start + 1);
|
||||
resource_size(&r));
|
||||
}
|
||||
|
||||
muram_vbase = ioremap(muram_pbase, max - muram_pbase + 1);
|
||||
|
@ -239,7 +239,7 @@ static int __init dart_init(struct device_node *dart_node)
|
||||
DARTMAP_RPNMASK);
|
||||
|
||||
/* Map in DART registers */
|
||||
dart = ioremap(r.start, r.end - r.start + 1);
|
||||
dart = ioremap(r.start, resource_size(&r));
|
||||
if (dart == NULL)
|
||||
panic("DART: Cannot map registers!");
|
||||
|
||||
|
@ -349,7 +349,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
msi->msi_regs = ioremap(res.start, res.end - res.start + 1);
|
||||
msi->msi_regs = ioremap(res.start, resource_size(&res));
|
||||
if (!msi->msi_regs) {
|
||||
dev_err(&dev->dev, "ioremap problem failed\n");
|
||||
goto error_out;
|
||||
|
@ -64,7 +64,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
|
||||
{
|
||||
resource_size_t pci_addr = res->start - offset;
|
||||
resource_size_t phys_addr = res->start;
|
||||
resource_size_t size = res->end - res->start + 1;
|
||||
resource_size_t size = resource_size(res);
|
||||
u32 flags = 0x80044000; /* enable & mem R/W */
|
||||
unsigned int i;
|
||||
|
||||
@ -108,7 +108,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
|
||||
char *name = hose->dn->full_name;
|
||||
|
||||
pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
|
||||
(u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
|
||||
(u64)rsrc->start, (u64)resource_size(rsrc));
|
||||
|
||||
if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) {
|
||||
win_idx = 2;
|
||||
@ -116,7 +116,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
|
||||
end_idx = 3;
|
||||
}
|
||||
|
||||
pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
|
||||
pci = ioremap(rsrc->start, resource_size(rsrc));
|
||||
if (!pci) {
|
||||
dev_err(hose->parent, "Unable to map ATMU registers\n");
|
||||
return;
|
||||
@ -153,9 +153,9 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
|
||||
} else {
|
||||
pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
|
||||
"phy base 0x%016llx.\n",
|
||||
(u64)hose->io_resource.start,
|
||||
(u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
|
||||
(u64)hose->io_base_phys);
|
||||
(u64)hose->io_resource.start,
|
||||
(u64)resource_size(&hose->io_resource),
|
||||
(u64)hose->io_base_phys);
|
||||
out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12));
|
||||
out_be32(&pci->pow[j].potear, 0);
|
||||
out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12));
|
||||
|
@ -1523,7 +1523,7 @@ int fsl_rio_setup(struct platform_device *dev)
|
||||
port->priv = priv;
|
||||
port->phys_efptr = 0x100;
|
||||
|
||||
priv->regs_win = ioremap(regs.start, regs.end - regs.start + 1);
|
||||
priv->regs_win = ioremap(regs.start, resource_size(®s));
|
||||
rio_regs_win = priv->regs_win;
|
||||
|
||||
/* Probe the master port phy type */
|
||||
|
@ -736,7 +736,7 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ipic->regs = ioremap(res.start, res.end - res.start + 1);
|
||||
ipic->regs = ioremap(res.start, resource_size(&res));
|
||||
|
||||
ipic->irqhost->host_data = ipic;
|
||||
|
||||
|
@ -129,7 +129,7 @@ int __init mmio_nvram_init(void)
|
||||
goto out;
|
||||
}
|
||||
nvram_addr = r.start;
|
||||
mmio_nvram_len = r.end - r.start + 1;
|
||||
mmio_nvram_len = resource_size(&r);
|
||||
if ( (!mmio_nvram_len) || (!nvram_addr) ) {
|
||||
printk(KERN_WARNING "nvram: address or length is 0\n");
|
||||
ret = -EIO;
|
||||
|
@ -166,7 +166,7 @@ int mpc8xx_pic_init(void)
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
siu_reg = ioremap(res.start, res.end - res.start + 1);
|
||||
siu_reg = ioremap(res.start, resource_size(&res));
|
||||
if (siu_reg == NULL) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
|
@ -125,11 +125,11 @@ static void mv64x60_udbg_init(void)
|
||||
|
||||
of_node_put(np);
|
||||
|
||||
mpsc_base = ioremap(r[0].start, r[0].end - r[0].start + 1);
|
||||
mpsc_base = ioremap(r[0].start, resource_size(&r[0]));
|
||||
if (!mpsc_base)
|
||||
return;
|
||||
|
||||
mpsc_intr_cause = ioremap(r[1].start, r[1].end - r[1].start + 1);
|
||||
mpsc_intr_cause = ioremap(r[1].start, resource_size(&r[1]));
|
||||
if (!mpsc_intr_cause) {
|
||||
iounmap(mpsc_base);
|
||||
return;
|
||||
|
@ -265,7 +265,7 @@ static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose,
|
||||
if (ppc4xx_setup_one_pci_PMM(hose, reg,
|
||||
res->start,
|
||||
res->start - hose->pci_mem_offset,
|
||||
res->end + 1 - res->start,
|
||||
resource_size(res),
|
||||
res->flags,
|
||||
j) == 0) {
|
||||
j++;
|
||||
@ -290,7 +290,7 @@ static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose,
|
||||
void __iomem *reg,
|
||||
const struct resource *res)
|
||||
{
|
||||
resource_size_t size = res->end - res->start + 1;
|
||||
resource_size_t size = resource_size(res);
|
||||
u32 sa;
|
||||
|
||||
/* Calculate window size */
|
||||
@ -349,7 +349,7 @@ static void __init ppc4xx_probe_pci_bridge(struct device_node *np)
|
||||
bus_range = of_get_property(np, "bus-range", NULL);
|
||||
|
||||
/* Map registers */
|
||||
reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
|
||||
reg = ioremap(rsrc_reg.start, resource_size(&rsrc_reg));
|
||||
if (reg == NULL) {
|
||||
printk(KERN_ERR "%s: Can't map registers !", np->full_name);
|
||||
goto fail;
|
||||
@ -465,7 +465,7 @@ static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose,
|
||||
if (ppc4xx_setup_one_pcix_POM(hose, reg,
|
||||
res->start,
|
||||
res->start - hose->pci_mem_offset,
|
||||
res->end + 1 - res->start,
|
||||
resource_size(res),
|
||||
res->flags,
|
||||
j) == 0) {
|
||||
j++;
|
||||
@ -492,7 +492,7 @@ static void __init ppc4xx_configure_pcix_PIMs(struct pci_controller *hose,
|
||||
int big_pim,
|
||||
int enable_msi_hole)
|
||||
{
|
||||
resource_size_t size = res->end - res->start + 1;
|
||||
resource_size_t size = resource_size(res);
|
||||
u32 sa;
|
||||
|
||||
/* RAM is always at 0 */
|
||||
@ -555,7 +555,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
|
||||
bus_range = of_get_property(np, "bus-range", NULL);
|
||||
|
||||
/* Map registers */
|
||||
reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
|
||||
reg = ioremap(rsrc_reg.start, resource_size(&rsrc_reg));
|
||||
if (reg == NULL) {
|
||||
printk(KERN_ERR "%s: Can't map registers !", np->full_name);
|
||||
goto fail;
|
||||
@ -1604,7 +1604,7 @@ static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port,
|
||||
if (ppc4xx_setup_one_pciex_POM(port, hose, mbase,
|
||||
res->start,
|
||||
res->start - hose->pci_mem_offset,
|
||||
res->end + 1 - res->start,
|
||||
resource_size(res),
|
||||
res->flags,
|
||||
j) == 0) {
|
||||
j++;
|
||||
@ -1639,7 +1639,7 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
|
||||
void __iomem *mbase,
|
||||
struct resource *res)
|
||||
{
|
||||
resource_size_t size = res->end - res->start + 1;
|
||||
resource_size_t size = resource_size(res);
|
||||
u64 sa;
|
||||
|
||||
if (port->endpoint) {
|
||||
|
@ -347,7 +347,7 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags,
|
||||
return;
|
||||
}
|
||||
|
||||
qe_ic->regs = ioremap(res.start, res.end - res.start + 1);
|
||||
qe_ic->regs = ioremap(res.start, resource_size(&res));
|
||||
|
||||
qe_ic->irqhost->host_data = qe_ic;
|
||||
qe_ic->hc_irq = qe_ic_irq_chip;
|
||||
|
@ -41,7 +41,7 @@ int par_io_init(struct device_node *np)
|
||||
ret = of_address_to_resource(np, 0, &res);
|
||||
if (ret)
|
||||
return ret;
|
||||
par_io = ioremap(res.start, res.end - res.start + 1);
|
||||
par_io = ioremap(res.start, resource_size(&res));
|
||||
|
||||
num_ports = of_get_property(np, "num-ports", NULL);
|
||||
if (num_ports)
|
||||
|
@ -247,7 +247,7 @@ static int __init icp_native_init_one_node(struct device_node *np,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (icp_native_map_one_cpu(*indx, r.start, r.end - r.start))
|
||||
if (icp_native_map_one_cpu(*indx, r.start, resource_size(&r)))
|
||||
return -1;
|
||||
|
||||
(*indx)++;
|
||||
|
@ -58,7 +58,7 @@ int register_trapped_io(struct trapped_io *tiop)
|
||||
|
||||
for (k = 0; k < tiop->num_resources; k++) {
|
||||
res = tiop->resource + k;
|
||||
len += roundup((res->end - res->start) + 1, PAGE_SIZE);
|
||||
len += roundup(resource_size(res), PAGE_SIZE);
|
||||
flags |= res->flags;
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ int register_trapped_io(struct trapped_io *tiop)
|
||||
(unsigned long)(tiop->virt_base + len),
|
||||
res->flags & IORESOURCE_IO ? "io" : "mmio",
|
||||
(unsigned long)res->start);
|
||||
len += roundup((res->end - res->start) + 1, PAGE_SIZE);
|
||||
len += roundup(resource_size(res), PAGE_SIZE);
|
||||
}
|
||||
|
||||
tiop->magic = IO_TRAPPED_MAGIC;
|
||||
@ -128,7 +128,7 @@ void __iomem *match_trapped_io_handler(struct list_head *list,
|
||||
return tiop->virt_base + voffs;
|
||||
}
|
||||
|
||||
len = (res->end - res->start) + 1;
|
||||
len = resource_size(res);
|
||||
voffs += roundup(len, PAGE_SIZE);
|
||||
}
|
||||
}
|
||||
@ -173,7 +173,7 @@ static unsigned long lookup_address(struct trapped_io *tiop,
|
||||
|
||||
for (k = 0; k < tiop->num_resources; k++) {
|
||||
res = tiop->resource + k;
|
||||
len = roundup((res->end - res->start) + 1, PAGE_SIZE);
|
||||
len = roundup(resource_size(res), PAGE_SIZE);
|
||||
if (address < (vaddr + len))
|
||||
return res->start + (address - vaddr);
|
||||
vaddr += len;
|
||||
|
@ -170,7 +170,7 @@ void __init reserve_crashkernel(void)
|
||||
if (crashk_res.end == crashk_res.start)
|
||||
goto disable;
|
||||
|
||||
crash_size = PAGE_ALIGN(crashk_res.end - crashk_res.start + 1);
|
||||
crash_size = PAGE_ALIGN(resource_size(&crashk_res));
|
||||
if (!crashk_res.start) {
|
||||
unsigned long max = memblock_end_of_DRAM() - memory_limit;
|
||||
crashk_res.start = __memblock_alloc_base(crash_size, PAGE_SIZE, max);
|
||||
|
@ -228,7 +228,7 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz)
|
||||
}
|
||||
|
||||
pa &= PAGE_MASK;
|
||||
sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1);
|
||||
sparc_mapiorange(bus, pa, res->start, resource_size(res));
|
||||
|
||||
return (void __iomem *)(unsigned long)(res->start + offset);
|
||||
}
|
||||
@ -240,7 +240,7 @@ static void _sparc_free_io(struct resource *res)
|
||||
{
|
||||
unsigned long plen;
|
||||
|
||||
plen = res->end - res->start + 1;
|
||||
plen = resource_size(res);
|
||||
BUG_ON((plen & (PAGE_SIZE-1)) != 0);
|
||||
sparc_unmapiorange(res->start, plen);
|
||||
release_resource(res);
|
||||
@ -331,9 +331,9 @@ static void sbus_free_coherent(struct device *dev, size_t n, void *p,
|
||||
}
|
||||
|
||||
n = PAGE_ALIGN(n);
|
||||
if ((res->end-res->start)+1 != n) {
|
||||
if (resource_size(res) != n) {
|
||||
printk("sbus_free_consistent: region 0x%lx asked 0x%zx\n",
|
||||
(long)((res->end-res->start)+1), n);
|
||||
(long)resource_size(res), n);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -504,9 +504,9 @@ static void pci32_free_coherent(struct device *dev, size_t n, void *p,
|
||||
}
|
||||
|
||||
n = PAGE_ALIGN(n);
|
||||
if ((res->end-res->start)+1 != n) {
|
||||
if (resource_size(res) != n) {
|
||||
printk("pci_free_consistent: region 0x%lx asked 0x%lx\n",
|
||||
(long)((res->end-res->start)+1), (long)n);
|
||||
(long)resource_size(res), (long)n);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -820,11 +820,9 @@ static int __pci_mmap_make_offset_bus(struct pci_dev *pdev, struct vm_area_struc
|
||||
unsigned long space_size, user_offset, user_size;
|
||||
|
||||
if (mmap_state == pci_mmap_io) {
|
||||
space_size = (pbm->io_space.end -
|
||||
pbm->io_space.start) + 1;
|
||||
space_size = resource_size(&pbm->io_space);
|
||||
} else {
|
||||
space_size = (pbm->mem_space.end -
|
||||
pbm->mem_space.start) + 1;
|
||||
space_size = resource_size(&pbm->mem_space);
|
||||
}
|
||||
|
||||
/* Make sure the request is in range. */
|
||||
|
@ -553,8 +553,7 @@ static void __init setup_bootmem_allocator(void)
|
||||
|
||||
#ifdef CONFIG_KEXEC
|
||||
if (crashk_res.start != crashk_res.end)
|
||||
reserve_bootmem(crashk_res.start,
|
||||
crashk_res.end - crashk_res.start + 1, 0);
|
||||
reserve_bootmem(crashk_res.start, resource_size(&crashk_res), 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1553,7 +1553,7 @@ static void __init calgary_fixup_one_tce_space(struct pci_dev *dev)
|
||||
continue;
|
||||
|
||||
/* cover the whole region */
|
||||
npages = (r->end - r->start) >> PAGE_SHIFT;
|
||||
npages = resource_size(r) >> PAGE_SHIFT;
|
||||
npages++;
|
||||
|
||||
iommu_range_reserve(tbl, r->start, npages);
|
||||
|
@ -234,7 +234,7 @@ void __init probe_roms(void)
|
||||
/* check for extension rom (ignore length byte!) */
|
||||
rom = isa_bus_to_virt(extension_rom_resource.start);
|
||||
if (romsignature(rom)) {
|
||||
length = extension_rom_resource.end - extension_rom_resource.start + 1;
|
||||
length = resource_size(&extension_rom_resource);
|
||||
if (romchecksum(rom, length)) {
|
||||
request_resource(&iomem_resource, &extension_rom_resource);
|
||||
upper = extension_rom_resource.start;
|
||||
|
@ -212,7 +212,7 @@ static int bsr_add_node(struct device_node *bn)
|
||||
|
||||
cur->bsr_minor = i + total_bsr_devs;
|
||||
cur->bsr_addr = res.start;
|
||||
cur->bsr_len = res.end - res.start + 1;
|
||||
cur->bsr_len = resource_size(&res);
|
||||
cur->bsr_bytes = bsr_bytes[i];
|
||||
cur->bsr_stride = bsr_stride[i];
|
||||
cur->bsr_dev = MKDEV(bsr_major, i + total_bsr_devs);
|
||||
|
@ -621,7 +621,7 @@ static int __devinit hwicap_setup(struct device *dev, int id,
|
||||
|
||||
drvdata->mem_start = regs_res->start;
|
||||
drvdata->mem_end = regs_res->end;
|
||||
drvdata->mem_size = regs_res->end - regs_res->start + 1;
|
||||
drvdata->mem_size = resource_size(regs_res);
|
||||
|
||||
if (!request_mem_region(drvdata->mem_start,
|
||||
drvdata->mem_size, DRIVER_NAME)) {
|
||||
|
@ -1304,8 +1304,7 @@ static int mv_xor_shared_probe(struct platform_device *pdev)
|
||||
if (!res)
|
||||
return -ENODEV;
|
||||
|
||||
msp->xor_base = devm_ioremap(&pdev->dev, res->start,
|
||||
res->end - res->start + 1);
|
||||
msp->xor_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
|
||||
if (!msp->xor_base)
|
||||
return -EBUSY;
|
||||
|
||||
@ -1314,7 +1313,7 @@ static int mv_xor_shared_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
|
||||
msp->xor_high_base = devm_ioremap(&pdev->dev, res->start,
|
||||
res->end - res->start + 1);
|
||||
resource_size(res));
|
||||
if (!msp->xor_high_base)
|
||||
return -EBUSY;
|
||||
|
||||
|
@ -140,7 +140,7 @@ static void __devinit cell_edac_init_csrows(struct mem_ctl_info *mci)
|
||||
if (of_node_to_nid(np) != priv->node)
|
||||
continue;
|
||||
csrow->first_page = r.start >> PAGE_SHIFT;
|
||||
csrow->nr_pages = (r.end - r.start + 1) >> PAGE_SHIFT;
|
||||
csrow->nr_pages = resource_size(&r) >> PAGE_SHIFT;
|
||||
csrow->last_page = csrow->first_page + csrow->nr_pages - 1;
|
||||
csrow->mtype = MEM_XDR;
|
||||
csrow->edac_mode = EDAC_SECDED;
|
||||
|
@ -538,15 +538,15 @@ static int __devinit mpc85xx_l2_err_probe(struct platform_device *op)
|
||||
/* we only need the error registers */
|
||||
r.start += 0xe00;
|
||||
|
||||
if (!devm_request_mem_region(&op->dev, r.start,
|
||||
r.end - r.start + 1, pdata->name)) {
|
||||
if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
|
||||
pdata->name)) {
|
||||
printk(KERN_ERR "%s: Error while requesting mem region\n",
|
||||
__func__);
|
||||
res = -EBUSY;
|
||||
goto err;
|
||||
}
|
||||
|
||||
pdata->l2_vbase = devm_ioremap(&op->dev, r.start, r.end - r.start + 1);
|
||||
pdata->l2_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r));
|
||||
if (!pdata->l2_vbase) {
|
||||
printk(KERN_ERR "%s: Unable to setup L2 err regs\n", __func__);
|
||||
res = -ENOMEM;
|
||||
@ -987,15 +987,15 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!devm_request_mem_region(&op->dev, r.start,
|
||||
r.end - r.start + 1, pdata->name)) {
|
||||
if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
|
||||
pdata->name)) {
|
||||
printk(KERN_ERR "%s: Error while requesting mem region\n",
|
||||
__func__);
|
||||
res = -EBUSY;
|
||||
goto err;
|
||||
}
|
||||
|
||||
pdata->mc_vbase = devm_ioremap(&op->dev, r.start, r.end - r.start + 1);
|
||||
pdata->mc_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r));
|
||||
if (!pdata->mc_vbase) {
|
||||
printk(KERN_ERR "%s: Unable to setup MC err regs\n", __func__);
|
||||
res = -ENOMEM;
|
||||
|
@ -581,8 +581,8 @@ static int __init gpio_probe(struct platform_device *pdev)
|
||||
if (!memres)
|
||||
goto err_no_resource;
|
||||
|
||||
if (request_mem_region(memres->start, memres->end - memres->start, "GPIO Controller")
|
||||
== NULL) {
|
||||
if (!request_mem_region(memres->start, resource_size(memres),
|
||||
"GPIO Controller")) {
|
||||
err = -ENODEV;
|
||||
goto err_no_ioregion;
|
||||
}
|
||||
@ -640,7 +640,7 @@ static int __init gpio_probe(struct platform_device *pdev)
|
||||
free_irq(gpio_ports[i].irq, &gpio_ports[i]);
|
||||
iounmap(virtbase);
|
||||
err_no_ioremap:
|
||||
release_mem_region(memres->start, memres->end - memres->start);
|
||||
release_mem_region(memres->start, resource_size(memres));
|
||||
err_no_ioregion:
|
||||
err_no_resource:
|
||||
clk_disable(clk);
|
||||
@ -660,7 +660,7 @@ static int __exit gpio_remove(struct platform_device *pdev)
|
||||
for (i = 0 ; i < U300_GPIO_NUM_PORTS; i++)
|
||||
free_irq(gpio_ports[i].irq, &gpio_ports[i]);
|
||||
iounmap(virtbase);
|
||||
release_mem_region(memres->start, memres->end - memres->start);
|
||||
release_mem_region(memres->start, resource_size(memres));
|
||||
clk_disable(clk);
|
||||
clk_put(clk);
|
||||
return 0;
|
||||
|
@ -342,7 +342,7 @@ static int __init palm_bk3710_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
mem_size = mem->end - mem->start + 1;
|
||||
mem_size = resource_size(mem);
|
||||
if (request_mem_region(mem->start, mem_size, "palm_bk3710") == NULL) {
|
||||
printk(KERN_ERR "failed to request memory region\n");
|
||||
return -EBUSY;
|
||||
|
@ -551,10 +551,10 @@ static int __init tx4939ide_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
|
||||
if (!devm_request_mem_region(&pdev->dev, res->start,
|
||||
res->end - res->start + 1, "tx4938ide"))
|
||||
resource_size(res), "tx4938ide"))
|
||||
return -EBUSY;
|
||||
mapbase = (unsigned long)devm_ioremap(&pdev->dev, res->start,
|
||||
res->end - res->start + 1);
|
||||
resource_size(res));
|
||||
if (!mapbase)
|
||||
return -EBUSY;
|
||||
memset(&hw, 0, sizeof(hw));
|
||||
|
@ -300,8 +300,7 @@ static int __devinit ps2_probe(struct sa1111_dev *dev)
|
||||
|
||||
out:
|
||||
sa1111_disable_device(ps2if->dev);
|
||||
release_mem_region(dev->res.start,
|
||||
dev->res.end - dev->res.start + 1);
|
||||
release_mem_region(dev->res.start, resource_size(&dev->res));
|
||||
free:
|
||||
sa1111_set_drvdata(dev, NULL);
|
||||
kfree(ps2if);
|
||||
@ -317,8 +316,7 @@ static int __devexit ps2_remove(struct sa1111_dev *dev)
|
||||
struct ps2if *ps2if = sa1111_get_drvdata(dev);
|
||||
|
||||
serio_unregister_port(ps2if->io);
|
||||
release_mem_region(dev->res.start,
|
||||
dev->res.end - dev->res.start + 1);
|
||||
release_mem_region(dev->res.start, resource_size(&dev->res));
|
||||
sa1111_set_drvdata(dev, NULL);
|
||||
|
||||
kfree(ps2if);
|
||||
|
@ -422,7 +422,7 @@ static int __init vpif_probe(struct platform_device *pdev)
|
||||
if (!res)
|
||||
return -ENOENT;
|
||||
|
||||
res_len = res->end - res->start + 1;
|
||||
res_len = resource_size(res);
|
||||
|
||||
res = request_mem_region(res->start, res_len, res->name);
|
||||
if (!res)
|
||||
|
@ -1768,14 +1768,13 @@ static int __devinit omap24xxcam_probe(struct platform_device *pdev)
|
||||
dev_err(cam->dev, "no mem resource?\n");
|
||||
goto err;
|
||||
}
|
||||
if (!request_mem_region(mem->start, (mem->end - mem->start) + 1,
|
||||
pdev->name)) {
|
||||
if (!request_mem_region(mem->start, resource_size(mem), pdev->name)) {
|
||||
dev_err(cam->dev,
|
||||
"cannot reserve camera register I/O region\n");
|
||||
goto err;
|
||||
}
|
||||
cam->mmio_base_phys = mem->start;
|
||||
cam->mmio_size = (mem->end - mem->start) + 1;
|
||||
cam->mmio_size = resource_size(mem);
|
||||
|
||||
/* map the region */
|
||||
cam->mmio_base = (unsigned long)
|
||||
|
@ -681,11 +681,11 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
|
||||
if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */
|
||||
NULL, NULL) >= 0) {
|
||||
c->mem_alloc = 1;
|
||||
sb->current_mem_size = 1 + res->end - res->start;
|
||||
sb->current_mem_size = resource_size(res);
|
||||
sb->current_mem_base = res->start;
|
||||
osm_info("%s: allocated %llu bytes of PCI memory at "
|
||||
"0x%016llX.\n", c->name,
|
||||
(unsigned long long)(1 + res->end - res->start),
|
||||
(unsigned long long)resource_size(res),
|
||||
(unsigned long long)res->start);
|
||||
}
|
||||
}
|
||||
@ -703,11 +703,11 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
|
||||
if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */
|
||||
NULL, NULL) >= 0) {
|
||||
c->io_alloc = 1;
|
||||
sb->current_io_size = 1 + res->end - res->start;
|
||||
sb->current_io_size = resource_size(res);
|
||||
sb->current_mem_base = res->start;
|
||||
osm_info("%s: allocated %llu bytes of PCI I/O at "
|
||||
"0x%016llX.\n", c->name,
|
||||
(unsigned long long)(1 + res->end - res->start),
|
||||
(unsigned long long)resource_size(res),
|
||||
(unsigned long long)res->start);
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ static int __devinit tc6387xb_probe(struct platform_device *dev)
|
||||
if (ret)
|
||||
goto err_resource;
|
||||
|
||||
tc6387xb->scr = ioremap(rscr->start, rscr->end - rscr->start + 1);
|
||||
tc6387xb->scr = ioremap(rscr->start, resource_size(rscr));
|
||||
if (!tc6387xb->scr) {
|
||||
ret = -ENOMEM;
|
||||
goto err_ioremap;
|
||||
|
@ -95,7 +95,7 @@ static int __init ssc_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
ssc->pdev = pdev;
|
||||
ssc->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
ssc->regs = ioremap(regs->start, resource_size(regs));
|
||||
if (!ssc->regs) {
|
||||
dev_dbg(&pdev->dev, "ioremap failed\n");
|
||||
retval = -EINVAL;
|
||||
|
@ -329,7 +329,7 @@ static int __init pwm_probe(struct platform_device *pdev)
|
||||
p->pdev = pdev;
|
||||
p->mask = *mp;
|
||||
p->irq = irq;
|
||||
p->base = ioremap(r->start, r->end - r->start + 1);
|
||||
p->base = ioremap(r->start, resource_size(r));
|
||||
if (!p->base)
|
||||
goto fail;
|
||||
p->clk = clk_get(&pdev->dev, "pwm_clk");
|
||||
|
@ -1595,7 +1595,7 @@ static int dw_mci_probe(struct platform_device *pdev)
|
||||
INIT_LIST_HEAD(&host->queue);
|
||||
|
||||
ret = -ENOMEM;
|
||||
host->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
host->regs = ioremap(regs->start, resource_size(regs));
|
||||
if (!host->regs)
|
||||
goto err_freehost;
|
||||
|
||||
|
@ -142,7 +142,7 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev)
|
||||
state->map.write = bfin_flash_write;
|
||||
state->map.copy_to = bfin_flash_copy_to;
|
||||
state->map.bankwidth = pdata->width;
|
||||
state->map.size = memory->end - memory->start + 1;
|
||||
state->map.size = resource_size(memory);
|
||||
state->map.virt = (void __iomem *)memory->start;
|
||||
state->map.phys = memory->start;
|
||||
state->map.map_priv_1 = (unsigned long)state;
|
||||
|
@ -155,7 +155,7 @@ static int ixp2000_flash_probe(struct platform_device *dev)
|
||||
if (!plat)
|
||||
return -ENODEV;
|
||||
|
||||
window_size = dev->resource->end - dev->resource->start + 1;
|
||||
window_size = resource_size(dev->resource);
|
||||
dev_info(&dev->dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n",
|
||||
ixp_data->nr_banks, ((u32)window_size >> 20));
|
||||
|
||||
@ -194,16 +194,17 @@ static int ixp2000_flash_probe(struct platform_device *dev)
|
||||
info->map.copy_to = ixp2000_flash_copy_to;
|
||||
|
||||
info->res = request_mem_region(dev->resource->start,
|
||||
dev->resource->end - dev->resource->start + 1,
|
||||
dev_name(&dev->dev));
|
||||
resource_size(dev->resource),
|
||||
dev_name(&dev->dev));
|
||||
if (!info->res) {
|
||||
dev_err(&dev->dev, "Could not reserve memory region\n");
|
||||
err = -ENOMEM;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
info->map.map_priv_1 = (unsigned long) ioremap(dev->resource->start,
|
||||
dev->resource->end - dev->resource->start + 1);
|
||||
info->map.map_priv_1 =
|
||||
(unsigned long)ioremap(dev->resource->start,
|
||||
resource_size(dev->resource));
|
||||
if (!info->map.map_priv_1) {
|
||||
dev_err(&dev->dev, "Failed to ioremap flash region\n");
|
||||
err = -EIO;
|
||||
|
@ -70,7 +70,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
|
||||
info->map.name = (char *) flash->name;
|
||||
info->map.bankwidth = flash->width;
|
||||
info->map.phys = res->start;
|
||||
info->map.size = res->end - res->start + 1;
|
||||
info->map.size = resource_size(res);
|
||||
info->parts = flash->parts;
|
||||
info->nr_parts = flash->nr_parts;
|
||||
|
||||
|
@ -513,7 +513,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
|
||||
|
||||
host->io_phys = (dma_addr_t)mem->start;
|
||||
|
||||
host->io_base = ioremap(mem->start, mem->end - mem->start + 1);
|
||||
host->io_base = ioremap(mem->start, resource_size(mem));
|
||||
if (host->io_base == NULL) {
|
||||
printk(KERN_ERR "atmel_nand: ioremap failed\n");
|
||||
res = -EIO;
|
||||
@ -547,7 +547,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
|
||||
if (no_ecc)
|
||||
nand_chip->ecc.mode = NAND_ECC_NONE;
|
||||
if (hard_ecc && regs) {
|
||||
host->ecc = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
host->ecc = ioremap(regs->start, resource_size(regs));
|
||||
if (host->ecc == NULL) {
|
||||
printk(KERN_ERR "atmel_nand: ioremap failed\n");
|
||||
res = -EIO;
|
||||
|
@ -380,7 +380,7 @@ static int __devinit bcm_umi_nand_probe(struct platform_device *pdev)
|
||||
return -ENXIO;
|
||||
|
||||
/* map physical address */
|
||||
bcm_umi_io_base = ioremap(r->start, r->end - r->start + 1);
|
||||
bcm_umi_io_base = ioremap(r->start, resource_size(r));
|
||||
|
||||
if (!bcm_umi_io_base) {
|
||||
printk(KERN_ERR "ioremap to access BCM UMI NAND chip failed\n");
|
||||
|
@ -713,7 +713,7 @@ static int __devinit mpc5121_nfc_probe(struct platform_device *op)
|
||||
}
|
||||
|
||||
regs_paddr = res.start;
|
||||
regs_size = res.end - res.start + 1;
|
||||
regs_size = resource_size(&res);
|
||||
|
||||
if (!devm_request_mem_region(dev, regs_paddr, regs_size, DRV_NAME)) {
|
||||
dev_err(dev, "Error requesting memory region!\n");
|
||||
|
@ -1646,7 +1646,7 @@ static int __devinit bcm_enet_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
iomem_size = res_mem->end - res_mem->start + 1;
|
||||
iomem_size = resource_size(res_mem);
|
||||
if (!request_mem_region(res_mem->start, iomem_size, "bcm63xx_enet")) {
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
@ -1861,7 +1861,7 @@ static int __devexit bcm_enet_remove(struct platform_device *pdev)
|
||||
/* release device resources */
|
||||
iounmap(priv->base);
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
|
||||
/* disable hw block clocks */
|
||||
if (priv->phy_clk) {
|
||||
@ -1897,7 +1897,7 @@ static int __devinit bcm_enet_shared_probe(struct platform_device *pdev)
|
||||
if (!res)
|
||||
return -ENODEV;
|
||||
|
||||
iomem_size = res->end - res->start + 1;
|
||||
iomem_size = resource_size(res);
|
||||
if (!request_mem_region(res->start, iomem_size, "bcm63xx_enet_dma"))
|
||||
return -EBUSY;
|
||||
|
||||
@ -1915,7 +1915,7 @@ static int __devexit bcm_enet_shared_remove(struct platform_device *pdev)
|
||||
|
||||
iounmap(bcm_enet_shared_base);
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -799,7 +799,7 @@ static __devinit int softing_pdev_probe(struct platform_device *pdev)
|
||||
if (!pres)
|
||||
goto platform_resource_failed;
|
||||
card->dpram_phys = pres->start;
|
||||
card->dpram_size = pres->end - pres->start + 1;
|
||||
card->dpram_size = resource_size(pres);
|
||||
card->dpram = ioremap_nocache(card->dpram_phys, card->dpram_size);
|
||||
if (!card->dpram) {
|
||||
dev_alert(&card->pdev->dev, "dpram ioremap failed\n");
|
||||
|
@ -1821,7 +1821,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
priv->emac_base_phys = res->start + pdata->ctrl_reg_offset;
|
||||
size = res->end - res->start + 1;
|
||||
size = resource_size(res);
|
||||
if (!request_mem_region(res->start, size, ndev->name)) {
|
||||
dev_err(&pdev->dev, "failed request_mem_region() for regs\n");
|
||||
rc = -ENXIO;
|
||||
@ -1926,7 +1926,7 @@ no_irq_res:
|
||||
cpdma_ctlr_destroy(priv->dma);
|
||||
no_dma:
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
iounmap(priv->remap_addr);
|
||||
|
||||
probe_quit:
|
||||
@ -1960,7 +1960,7 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev)
|
||||
cpdma_chan_destroy(priv->rxchan);
|
||||
cpdma_ctlr_destroy(priv->dma);
|
||||
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
|
||||
unregister_netdev(ndev);
|
||||
iounmap(priv->remap_addr);
|
||||
|
@ -965,7 +965,7 @@ static int __devinit ethoc_probe(struct platform_device *pdev)
|
||||
priv = netdev_priv(netdev);
|
||||
priv->netdev = netdev;
|
||||
priv->dma_alloc = 0;
|
||||
priv->io_region_size = mmio->end - mmio->start + 1;
|
||||
priv->io_region_size = resource_size(mmio);
|
||||
|
||||
priv->iobase = devm_ioremap_nocache(&pdev->dev, netdev->base_addr,
|
||||
resource_size(mmio));
|
||||
|
@ -867,10 +867,11 @@ static int __devinit mpc52xx_fec_probe(struct platform_device *op)
|
||||
"Error while parsing device node resource\n" );
|
||||
goto err_netdev;
|
||||
}
|
||||
if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) {
|
||||
if (resource_size(&mem) < sizeof(struct mpc52xx_fec)) {
|
||||
printk(KERN_ERR DRIVER_NAME
|
||||
" - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
|
||||
(unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec));
|
||||
" - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
|
||||
(unsigned long)resource_size(&mem),
|
||||
sizeof(struct mpc52xx_fec));
|
||||
rv = -EINVAL;
|
||||
goto err_netdev;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (res.end - res.start < 13)
|
||||
if (resource_size(&res) <= 13)
|
||||
return -ENODEV;
|
||||
|
||||
/* This should really encode the pin number as well, but all
|
||||
@ -139,7 +139,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
|
||||
return -ENODEV;
|
||||
mdc_pin = *data;
|
||||
|
||||
bitbang->dir = ioremap(res.start, res.end - res.start + 1);
|
||||
bitbang->dir = ioremap(res.start, resource_size(&res));
|
||||
if (!bitbang->dir)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -136,7 +136,7 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
|
||||
|
||||
snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
|
||||
|
||||
fec->fecp = ioremap(res.start, res.end - res.start + 1);
|
||||
fec->fecp = ioremap(res.start, resource_size(&res));
|
||||
if (!fec->fecp)
|
||||
goto out_fec;
|
||||
|
||||
|
@ -491,7 +491,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
|
||||
spin_lock_init(&etsects->lock);
|
||||
|
||||
etsects->regs = ioremap(etsects->rsrc->start,
|
||||
1 + etsects->rsrc->end - etsects->rsrc->start);
|
||||
resource_size(etsects->rsrc));
|
||||
if (!etsects->regs) {
|
||||
pr_err("ioremap ptp registers failed\n");
|
||||
goto no_ioremap;
|
||||
|
@ -2770,7 +2770,7 @@ static int __devinit emac_probe(struct platform_device *ofdev)
|
||||
}
|
||||
// TODO : request_mem_region
|
||||
dev->emacp = ioremap(dev->rsrc_regs.start,
|
||||
dev->rsrc_regs.end - dev->rsrc_regs.start + 1);
|
||||
resource_size(&dev->rsrc_regs));
|
||||
if (dev->emacp == NULL) {
|
||||
printk(KERN_ERR "%s: Can't map device registers!\n",
|
||||
np->full_name);
|
||||
|
@ -1169,7 +1169,7 @@ static int __init macb_probe(struct platform_device *pdev)
|
||||
clk_enable(bp->hclk);
|
||||
#endif
|
||||
|
||||
bp->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
bp->regs = ioremap(regs->start, resource_size(regs));
|
||||
if (!bp->regs) {
|
||||
dev_err(&pdev->dev, "failed to map registers, aborting.\n");
|
||||
err = -ENOMEM;
|
||||
|
@ -2593,7 +2593,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
|
||||
if (msp == NULL)
|
||||
goto out;
|
||||
|
||||
msp->base = ioremap(res->start, res->end - res->start + 1);
|
||||
msp->base = ioremap(res->start, resource_size(res));
|
||||
if (msp->base == NULL)
|
||||
goto out_free;
|
||||
|
||||
|
@ -1502,7 +1502,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
|
||||
err = -ENODEV;
|
||||
goto err_netdev;
|
||||
}
|
||||
pep->base = ioremap(res->start, res->end - res->start + 1);
|
||||
pep->base = ioremap(res->start, resource_size(res));
|
||||
if (pep->base == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto err_netdev;
|
||||
|
@ -2597,7 +2597,7 @@ static int __devinit sbmac_probe(struct platform_device *pldev)
|
||||
|
||||
res = platform_get_resource(pldev, IORESOURCE_MEM, 0);
|
||||
BUG_ON(!res);
|
||||
sbm_base = ioremap_nocache(res->start, res->end - res->start + 1);
|
||||
sbm_base = ioremap_nocache(res->start, resource_size(res));
|
||||
if (!sbm_base) {
|
||||
printk(KERN_ERR "%s: unable to map device registers\n",
|
||||
dev_name(&pldev->dev));
|
||||
|
@ -293,7 +293,7 @@ static int parport_ax88796_probe(struct platform_device *pdev)
|
||||
goto exit_mem;
|
||||
}
|
||||
|
||||
size = (res->end - res->start) + 1;
|
||||
size = resource_size(res);
|
||||
spacing = size / 3;
|
||||
|
||||
dd->io = request_mem_region(res->start, size, pdev->name);
|
||||
|
@ -50,29 +50,26 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
|
||||
pci_bus_for_each_resource(bus, res, index) {
|
||||
if (res && (res->flags & IORESOURCE_MEM) &&
|
||||
!(res->flags & IORESOURCE_PREFETCH)) {
|
||||
out += sprintf(out, "start = %8.8llx, "
|
||||
"length = %8.8llx\n",
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)(res->end - res->start));
|
||||
out += sprintf(out, "start = %8.8llx, length = %8.8llx\n",
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)resource_size(res));
|
||||
}
|
||||
}
|
||||
out += sprintf(out, "Free resources: prefetchable memory\n");
|
||||
pci_bus_for_each_resource(bus, res, index) {
|
||||
if (res && (res->flags & IORESOURCE_MEM) &&
|
||||
(res->flags & IORESOURCE_PREFETCH)) {
|
||||
out += sprintf(out, "start = %8.8llx, "
|
||||
"length = %8.8llx\n",
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)(res->end - res->start));
|
||||
out += sprintf(out, "start = %8.8llx, length = %8.8llx\n",
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)resource_size(res));
|
||||
}
|
||||
}
|
||||
out += sprintf(out, "Free resources: IO\n");
|
||||
pci_bus_for_each_resource(bus, res, index) {
|
||||
if (res && (res->flags & IORESOURCE_IO)) {
|
||||
out += sprintf(out, "start = %8.8llx, "
|
||||
"length = %8.8llx\n",
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)(res->end - res->start));
|
||||
out += sprintf(out, "start = %8.8llx, length = %8.8llx\n",
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)resource_size(res));
|
||||
}
|
||||
}
|
||||
out += sprintf(out, "Free resources: bus numbers\n");
|
||||
|
@ -283,8 +283,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* reserve chip-select regions */
|
||||
if (!request_mem_region(io->start, io->end + 1 - io->start,
|
||||
driver_name)) {
|
||||
if (!request_mem_region(io->start, resource_size(io), driver_name)) {
|
||||
status = -ENXIO;
|
||||
goto fail1;
|
||||
}
|
||||
@ -308,7 +307,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
fail2:
|
||||
release_mem_region(io->start, io->end + 1 - io->start);
|
||||
release_mem_region(io->start, resource_size(io));
|
||||
fail1:
|
||||
if (cf->socket.io_offset)
|
||||
iounmap((void __iomem *) cf->socket.io_offset);
|
||||
@ -339,7 +338,7 @@ static int __exit at91_cf_remove(struct platform_device *pdev)
|
||||
struct resource *io = cf->socket.io[0].res;
|
||||
|
||||
pcmcia_unregister_socket(&cf->socket);
|
||||
release_mem_region(io->start, io->end + 1 - io->start);
|
||||
release_mem_region(io->start, resource_size(io));
|
||||
iounmap((void __iomem *) cf->socket.io_offset);
|
||||
if (board->irq_pin) {
|
||||
free_irq(board->irq_pin, cf);
|
||||
|
@ -209,9 +209,9 @@ static int __devinit electra_cf_probe(struct platform_device *ofdev)
|
||||
|
||||
cf->ofdev = ofdev;
|
||||
cf->mem_phys = mem.start;
|
||||
cf->mem_size = PAGE_ALIGN(mem.end - mem.start);
|
||||
cf->mem_size = PAGE_ALIGN(resource_size(&mem));
|
||||
cf->mem_base = ioremap(cf->mem_phys, cf->mem_size);
|
||||
cf->io_size = PAGE_ALIGN(io.end - io.start);
|
||||
cf->io_size = PAGE_ALIGN(resource_size(&io));
|
||||
|
||||
area = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END);
|
||||
if (area == NULL)
|
||||
|
@ -135,7 +135,7 @@ static int iodyn_find_io(struct pcmcia_socket *s, unsigned int attr,
|
||||
try = res->end + 1;
|
||||
if ((*base == 0) || (*base == try)) {
|
||||
if (adjust_resource(s->io[i].res, res->start,
|
||||
res->end - res->start + num + 1))
|
||||
resource_size(res) + num))
|
||||
continue;
|
||||
*base = try;
|
||||
s->io[i].InUse += num;
|
||||
@ -147,8 +147,8 @@ static int iodyn_find_io(struct pcmcia_socket *s, unsigned int attr,
|
||||
try = res->start - num;
|
||||
if ((*base == 0) || (*base == try)) {
|
||||
if (adjust_resource(s->io[i].res,
|
||||
res->start - num,
|
||||
res->end - res->start + num + 1))
|
||||
res->start - num,
|
||||
resource_size(res) + num))
|
||||
continue;
|
||||
*base = try;
|
||||
s->io[i].InUse += num;
|
||||
|
@ -770,7 +770,7 @@ static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr,
|
||||
res->end + num);
|
||||
if (!ret) {
|
||||
ret = adjust_resource(s->io[i].res, res->start,
|
||||
res->end - res->start + num + 1);
|
||||
resource_size(res) + num);
|
||||
if (ret)
|
||||
continue;
|
||||
*base = try;
|
||||
@ -788,8 +788,8 @@ static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr,
|
||||
res->end);
|
||||
if (!ret) {
|
||||
ret = adjust_resource(s->io[i].res,
|
||||
res->start - num,
|
||||
res->end - res->start + num + 1);
|
||||
res->start - num,
|
||||
resource_size(res) + num);
|
||||
if (ret)
|
||||
continue;
|
||||
*base = try;
|
||||
|
@ -1018,7 +1018,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev,
|
||||
io->minimum = p->start;
|
||||
io->maximum = p->end;
|
||||
io->alignment = 0; /* Correct? */
|
||||
io->address_length = p->end - p->start + 1;
|
||||
io->address_length = resource_size(p);
|
||||
} else {
|
||||
io->minimum = 0;
|
||||
io->address_length = 0;
|
||||
@ -1036,7 +1036,7 @@ static void pnpacpi_encode_fixed_io(struct pnp_dev *dev,
|
||||
|
||||
if (pnp_resource_enabled(p)) {
|
||||
fixed_io->address = p->start;
|
||||
fixed_io->address_length = p->end - p->start + 1;
|
||||
fixed_io->address_length = resource_size(p);
|
||||
} else {
|
||||
fixed_io->address = 0;
|
||||
fixed_io->address_length = 0;
|
||||
@ -1059,7 +1059,7 @@ static void pnpacpi_encode_mem24(struct pnp_dev *dev,
|
||||
memory24->minimum = p->start;
|
||||
memory24->maximum = p->end;
|
||||
memory24->alignment = 0;
|
||||
memory24->address_length = p->end - p->start + 1;
|
||||
memory24->address_length = resource_size(p);
|
||||
} else {
|
||||
memory24->minimum = 0;
|
||||
memory24->address_length = 0;
|
||||
@ -1083,7 +1083,7 @@ static void pnpacpi_encode_mem32(struct pnp_dev *dev,
|
||||
memory32->minimum = p->start;
|
||||
memory32->maximum = p->end;
|
||||
memory32->alignment = 0;
|
||||
memory32->address_length = p->end - p->start + 1;
|
||||
memory32->address_length = resource_size(p);
|
||||
} else {
|
||||
memory32->minimum = 0;
|
||||
memory32->alignment = 0;
|
||||
@ -1106,7 +1106,7 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev,
|
||||
p->flags & IORESOURCE_MEM_WRITEABLE ?
|
||||
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
|
||||
fixed_memory32->address = p->start;
|
||||
fixed_memory32->address_length = p->end - p->start + 1;
|
||||
fixed_memory32->address_length = resource_size(p);
|
||||
} else {
|
||||
fixed_memory32->address = 0;
|
||||
fixed_memory32->address_length = 0;
|
||||
|
@ -505,7 +505,7 @@ static void pnpbios_encode_mem(struct pnp_dev *dev, unsigned char *p,
|
||||
|
||||
if (pnp_resource_enabled(res)) {
|
||||
base = res->start;
|
||||
len = res->end - res->start + 1;
|
||||
len = resource_size(res);
|
||||
} else {
|
||||
base = 0;
|
||||
len = 0;
|
||||
@ -529,7 +529,7 @@ static void pnpbios_encode_mem32(struct pnp_dev *dev, unsigned char *p,
|
||||
|
||||
if (pnp_resource_enabled(res)) {
|
||||
base = res->start;
|
||||
len = res->end - res->start + 1;
|
||||
len = resource_size(res);
|
||||
} else {
|
||||
base = 0;
|
||||
len = 0;
|
||||
@ -559,7 +559,7 @@ static void pnpbios_encode_fixed_mem32(struct pnp_dev *dev, unsigned char *p,
|
||||
|
||||
if (pnp_resource_enabled(res)) {
|
||||
base = res->start;
|
||||
len = res->end - res->start + 1;
|
||||
len = resource_size(res);
|
||||
} else {
|
||||
base = 0;
|
||||
len = 0;
|
||||
@ -617,7 +617,7 @@ static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p,
|
||||
|
||||
if (pnp_resource_enabled(res)) {
|
||||
base = res->start;
|
||||
len = res->end - res->start + 1;
|
||||
len = resource_size(res);
|
||||
} else {
|
||||
base = 0;
|
||||
len = 0;
|
||||
@ -636,11 +636,11 @@ static void pnpbios_encode_fixed_port(struct pnp_dev *dev, unsigned char *p,
|
||||
struct resource *res)
|
||||
{
|
||||
unsigned long base = res->start;
|
||||
unsigned long len = res->end - res->start + 1;
|
||||
unsigned long len = resource_size(res);
|
||||
|
||||
if (pnp_resource_enabled(res)) {
|
||||
base = res->start;
|
||||
len = res->end - res->start + 1;
|
||||
len = resource_size(res);
|
||||
} else {
|
||||
base = 0;
|
||||
len = 0;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user