@@ -332,14 +332,14 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev,
xspi->irq = r_irq->start;
- if (!request_mem_region(r_mem->start,
- r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) {
+ if (!request_mem_region(r_mem->start, resource_size(r_mem),
+ XILINX_SPI_NAME)) {
rc = -ENXIO;
dev_warn(&ofdev->dev, "memory request failure\n");
goto put_master;
}
- xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1);
+ xspi->regs = ioremap(r_mem->start, resource_size(r_mem));
if (xspi->regs == NULL) {
rc = -ENOMEM;
dev_warn(&ofdev->dev, "ioremap failure\n");