Commit 24cb2335 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

char serial: switch drivers to ioremap_nocache

Simple search/replace except for synclink.c where I noticed a real bug and
fixed it too.  It was doing NULL + offset, then checking for NULL if the remap
failed.
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Acked-by: default avatarJiri Slaby <jirislaby@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a6fc819e
...@@ -199,7 +199,7 @@ static int __init applicom_init(void) ...@@ -199,7 +199,7 @@ static int __init applicom_init(void)
if (pci_enable_device(dev)) if (pci_enable_device(dev))
return -EIO; return -EIO;
RamIO = ioremap(pci_resource_start(dev, 0), LEN_RAM_IO); RamIO = ioremap_nocache(pci_resource_start(dev, 0), LEN_RAM_IO);
if (!RamIO) { if (!RamIO) {
printk(KERN_INFO "ac.o: Failed to ioremap PCI memory " printk(KERN_INFO "ac.o: Failed to ioremap PCI memory "
...@@ -254,7 +254,7 @@ static int __init applicom_init(void) ...@@ -254,7 +254,7 @@ static int __init applicom_init(void)
/* Now try the specified ISA cards */ /* Now try the specified ISA cards */
for (i = 0; i < MAX_ISA_BOARD; i++) { for (i = 0; i < MAX_ISA_BOARD; i++) {
RamIO = ioremap(mem + (LEN_RAM_IO * i), LEN_RAM_IO); RamIO = ioremap_nocache(mem + (LEN_RAM_IO * i), LEN_RAM_IO);
if (!RamIO) { if (!RamIO) {
printk(KERN_INFO "ac.o: Failed to ioremap the ISA card's memory space (slot #%d)\n", i + 1); printk(KERN_INFO "ac.o: Failed to ioremap the ISA card's memory space (slot #%d)\n", i + 1);
......
...@@ -3257,7 +3257,7 @@ static int stli_initecp(struct stlibrd *brdp) ...@@ -3257,7 +3257,7 @@ static int stli_initecp(struct stlibrd *brdp)
*/ */
EBRDINIT(brdp); EBRDINIT(brdp);
brdp->membase = ioremap(brdp->memaddr, brdp->memsize); brdp->membase = ioremap_nocache(brdp->memaddr, brdp->memsize);
if (brdp->membase == NULL) { if (brdp->membase == NULL) {
retval = -ENOMEM; retval = -ENOMEM;
goto err_reg; goto err_reg;
...@@ -3414,7 +3414,7 @@ static int stli_initonb(struct stlibrd *brdp) ...@@ -3414,7 +3414,7 @@ static int stli_initonb(struct stlibrd *brdp)
*/ */
EBRDINIT(brdp); EBRDINIT(brdp);
brdp->membase = ioremap(brdp->memaddr, brdp->memsize); brdp->membase = ioremap_nocache(brdp->memaddr, brdp->memsize);
if (brdp->membase == NULL) { if (brdp->membase == NULL) {
retval = -ENOMEM; retval = -ENOMEM;
goto err_reg; goto err_reg;
...@@ -3665,7 +3665,7 @@ static int stli_eisamemprobe(struct stlibrd *brdp) ...@@ -3665,7 +3665,7 @@ static int stli_eisamemprobe(struct stlibrd *brdp)
*/ */
for (i = 0; (i < stli_eisamempsize); i++) { for (i = 0; (i < stli_eisamempsize); i++) {
brdp->memaddr = stli_eisamemprobeaddrs[i]; brdp->memaddr = stli_eisamemprobeaddrs[i];
brdp->membase = ioremap(brdp->memaddr, brdp->memsize); brdp->membase = ioremap_nocache(brdp->memaddr, brdp->memsize);
if (brdp->membase == NULL) if (brdp->membase == NULL)
continue; continue;
......
...@@ -937,7 +937,7 @@ static int __devinit moxa_pci_probe(struct pci_dev *pdev, ...@@ -937,7 +937,7 @@ static int __devinit moxa_pci_probe(struct pci_dev *pdev,
goto err; goto err;
} }
board->basemem = ioremap(pci_resource_start(pdev, 2), 0x4000); board->basemem = ioremap_nocache(pci_resource_start(pdev, 2), 0x4000);
if (board->basemem == NULL) { if (board->basemem == NULL) {
dev_err(&pdev->dev, "can't remap io space 2\n"); dev_err(&pdev->dev, "can't remap io space 2\n");
goto err_reg; goto err_reg;
...@@ -1042,7 +1042,7 @@ static int __init moxa_init(void) ...@@ -1042,7 +1042,7 @@ static int __init moxa_init(void)
brd->numPorts = type[i] == MOXA_BOARD_C218_ISA ? 8 : brd->numPorts = type[i] == MOXA_BOARD_C218_ISA ? 8 :
numports[i]; numports[i];
brd->busType = MOXA_BUS_TYPE_ISA; brd->busType = MOXA_BUS_TYPE_ISA;
brd->basemem = ioremap(baseaddr[i], 0x4000); brd->basemem = ioremap_nocache(baseaddr[i], 0x4000);
if (!brd->basemem) { if (!brd->basemem) {
printk(KERN_ERR "MOXA: can't remap %lx\n", printk(KERN_ERR "MOXA: can't remap %lx\n",
baseaddr[i]); baseaddr[i]);
......
...@@ -1407,7 +1407,7 @@ static int __devinit nozomi_card_init(struct pci_dev *pdev, ...@@ -1407,7 +1407,7 @@ static int __devinit nozomi_card_init(struct pci_dev *pdev,
/* Find out what card type it is */ /* Find out what card type it is */
nozomi_get_card_type(dc); nozomi_get_card_type(dc);
dc->base_addr = ioremap(start, dc->card_type); dc->base_addr = ioremap_nocache(start, dc->card_type);
if (!dc->base_addr) { if (!dc->base_addr) {
dev_err(&pdev->dev, "Unable to map card MMIO\n"); dev_err(&pdev->dev, "Unable to map card MMIO\n");
ret = -ENODEV; ret = -ENODEV;
......
...@@ -2540,7 +2540,7 @@ static int __devinit sx_eisa_probe(struct device *dev) ...@@ -2540,7 +2540,7 @@ static int __devinit sx_eisa_probe(struct device *dev)
goto err_flag; goto err_flag;
} }
board->base2 = board->base2 =
board->base = ioremap(board->hw_base, SI2_EISA_WINDOW_LEN); board->base = ioremap_nocache(board->hw_base, SI2_EISA_WINDOW_LEN);
if (!board->base) { if (!board->base) {
dev_err(dev, "can't remap memory\n"); dev_err(dev, "can't remap memory\n");
goto err_reg; goto err_reg;
...@@ -2617,7 +2617,7 @@ static void __devinit fix_sx_pci(struct pci_dev *pdev, struct sx_board *board) ...@@ -2617,7 +2617,7 @@ static void __devinit fix_sx_pci(struct pci_dev *pdev, struct sx_board *board)
pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &hwbase); pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &hwbase);
hwbase &= PCI_BASE_ADDRESS_MEM_MASK; hwbase &= PCI_BASE_ADDRESS_MEM_MASK;
rebase = ioremap(hwbase, 0x80); rebase = ioremap_nocache(hwbase, 0x80);
t = readl(rebase + CNTRL_REG_OFFSET); t = readl(rebase + CNTRL_REG_OFFSET);
if (t != CNTRL_REG_GOODVALUE) { if (t != CNTRL_REG_GOODVALUE) {
printk(KERN_DEBUG "sx: performing cntrl reg fix: %08x -> " printk(KERN_DEBUG "sx: performing cntrl reg fix: %08x -> "
...@@ -2761,7 +2761,7 @@ static int __init sx_init(void) ...@@ -2761,7 +2761,7 @@ static int __init sx_init(void)
if (!request_region(board->hw_base, board->hw_len, "sx")) if (!request_region(board->hw_base, board->hw_len, "sx"))
continue; continue;
board->base2 = board->base2 =
board->base = ioremap(board->hw_base, board->hw_len); board->base = ioremap_nocache(board->hw_base, board->hw_len);
if (!board->base) if (!board->base)
goto err_sx_reg; goto err_sx_reg;
board->flags &= ~SX_BOARD_TYPE; board->flags &= ~SX_BOARD_TYPE;
...@@ -2785,7 +2785,7 @@ static int __init sx_init(void) ...@@ -2785,7 +2785,7 @@ static int __init sx_init(void)
if (!request_region(board->hw_base, board->hw_len, "sx")) if (!request_region(board->hw_base, board->hw_len, "sx"))
continue; continue;
board->base2 = board->base2 =
board->base = ioremap(board->hw_base, board->hw_len); board->base = ioremap_nocache(board->hw_base, board->hw_len);
if (!board->base) if (!board->base)
goto err_si_reg; goto err_si_reg;
board->flags &= ~SX_BOARD_TYPE; board->flags &= ~SX_BOARD_TYPE;
...@@ -2808,7 +2808,7 @@ static int __init sx_init(void) ...@@ -2808,7 +2808,7 @@ static int __init sx_init(void)
if (!request_region(board->hw_base, board->hw_len, "sx")) if (!request_region(board->hw_base, board->hw_len, "sx"))
continue; continue;
board->base2 = board->base2 =
board->base = ioremap(board->hw_base, board->hw_len); board->base = ioremap_nocache(board->hw_base, board->hw_len);
if (!board->base) if (!board->base)
goto err_si1_reg; goto err_si1_reg;
board->flags &= ~SX_BOARD_TYPE; board->flags &= ~SX_BOARD_TYPE;
......
...@@ -4150,7 +4150,8 @@ static int mgsl_claim_resources(struct mgsl_struct *info) ...@@ -4150,7 +4150,8 @@ static int mgsl_claim_resources(struct mgsl_struct *info)
} }
info->lcr_mem_requested = true; info->lcr_mem_requested = true;
info->memory_base = ioremap(info->phys_memory_base,0x40000); info->memory_base = ioremap_nocache(info->phys_memory_base,
0x40000);
if (!info->memory_base) { if (!info->memory_base) {
printk( "%s(%d):Cant map shared memory on device %s MemAddr=%08X\n", printk( "%s(%d):Cant map shared memory on device %s MemAddr=%08X\n",
__FILE__,__LINE__,info->device_name, info->phys_memory_base ); __FILE__,__LINE__,info->device_name, info->phys_memory_base );
...@@ -4163,12 +4164,14 @@ static int mgsl_claim_resources(struct mgsl_struct *info) ...@@ -4163,12 +4164,14 @@ static int mgsl_claim_resources(struct mgsl_struct *info)
goto errout; goto errout;
} }
info->lcr_base = ioremap(info->phys_lcr_base,PAGE_SIZE) + info->lcr_offset; info->lcr_base = ioremap_nocache(info->phys_lcr_base,
PAGE_SIZE);
if (!info->lcr_base) { if (!info->lcr_base) {
printk( "%s(%d):Cant map LCR memory on device %s MemAddr=%08X\n", printk( "%s(%d):Cant map LCR memory on device %s MemAddr=%08X\n",
__FILE__,__LINE__,info->device_name, info->phys_lcr_base ); __FILE__,__LINE__,info->device_name, info->phys_lcr_base );
goto errout; goto errout;
} }
info->lcr_base += info->lcr_offset;
} else { } else {
/* claim DMA channel */ /* claim DMA channel */
......
...@@ -3350,7 +3350,7 @@ static int claim_resources(struct slgt_info *info) ...@@ -3350,7 +3350,7 @@ static int claim_resources(struct slgt_info *info)
else else
info->reg_addr_requested = true; info->reg_addr_requested = true;
info->reg_addr = ioremap(info->phys_reg_addr, SLGT_REG_SIZE); info->reg_addr = ioremap_nocache(info->phys_reg_addr, SLGT_REG_SIZE);
if (!info->reg_addr) { if (!info->reg_addr) {
DBGERR(("%s cant map device registers, addr=%08X\n", DBGERR(("%s cant map device registers, addr=%08X\n",
info->device_name, info->phys_reg_addr)); info->device_name, info->phys_reg_addr));
......
...@@ -3643,7 +3643,8 @@ static int claim_resources(SLMP_INFO *info) ...@@ -3643,7 +3643,8 @@ static int claim_resources(SLMP_INFO *info)
else else
info->sca_statctrl_requested = true; info->sca_statctrl_requested = true;
info->memory_base = ioremap(info->phys_memory_base,SCA_MEM_SIZE); info->memory_base = ioremap_nocache(info->phys_memory_base,
SCA_MEM_SIZE);
if (!info->memory_base) { if (!info->memory_base) {
printk( "%s(%d):%s Cant map shared memory, MemAddr=%08X\n", printk( "%s(%d):%s Cant map shared memory, MemAddr=%08X\n",
__FILE__,__LINE__,info->device_name, info->phys_memory_base ); __FILE__,__LINE__,info->device_name, info->phys_memory_base );
...@@ -3651,7 +3652,7 @@ static int claim_resources(SLMP_INFO *info) ...@@ -3651,7 +3652,7 @@ static int claim_resources(SLMP_INFO *info)
goto errout; goto errout;
} }
info->lcr_base = ioremap(info->phys_lcr_base,PAGE_SIZE); info->lcr_base = ioremap_nocache(info->phys_lcr_base, PAGE_SIZE);
if (!info->lcr_base) { if (!info->lcr_base) {
printk( "%s(%d):%s Cant map LCR memory, MemAddr=%08X\n", printk( "%s(%d):%s Cant map LCR memory, MemAddr=%08X\n",
__FILE__,__LINE__,info->device_name, info->phys_lcr_base ); __FILE__,__LINE__,info->device_name, info->phys_lcr_base );
...@@ -3660,7 +3661,7 @@ static int claim_resources(SLMP_INFO *info) ...@@ -3660,7 +3661,7 @@ static int claim_resources(SLMP_INFO *info)
} }
info->lcr_base += info->lcr_offset; info->lcr_base += info->lcr_offset;
info->sca_base = ioremap(info->phys_sca_base,PAGE_SIZE); info->sca_base = ioremap_nocache(info->phys_sca_base, PAGE_SIZE);
if (!info->sca_base) { if (!info->sca_base) {
printk( "%s(%d):%s Cant map SCA memory, MemAddr=%08X\n", printk( "%s(%d):%s Cant map SCA memory, MemAddr=%08X\n",
__FILE__,__LINE__,info->device_name, info->phys_sca_base ); __FILE__,__LINE__,info->device_name, info->phys_sca_base );
...@@ -3669,7 +3670,8 @@ static int claim_resources(SLMP_INFO *info) ...@@ -3669,7 +3670,8 @@ static int claim_resources(SLMP_INFO *info)
} }
info->sca_base += info->sca_offset; info->sca_base += info->sca_offset;
info->statctrl_base = ioremap(info->phys_statctrl_base,PAGE_SIZE); info->statctrl_base = ioremap_nocache(info->phys_statctrl_base,
PAGE_SIZE);
if (!info->statctrl_base) { if (!info->statctrl_base) {
printk( "%s(%d):%s Cant map SCA Status/Control memory, MemAddr=%08X\n", printk( "%s(%d):%s Cant map SCA Status/Control memory, MemAddr=%08X\n",
__FILE__,__LINE__,info->device_name, info->phys_statctrl_base ); __FILE__,__LINE__,info->device_name, info->phys_statctrl_base );
......
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