Skip to content

Commit

Permalink
cris/PCI: Use generic pci_mmap_resource_range()
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
  • Loading branch information
dwmw2 authored and bjorn-helgaas committed Apr 20, 2017
1 parent 00d2904 commit 3efdd5f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
23 changes: 0 additions & 23 deletions arch/cris/arch-v32/drivers/pci/bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,6 @@ void pcibios_set_master(struct pci_dev *dev)
pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
}

int pci_mmap_page_range(struct pci_dev *dev, int bar,
struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine)
{
unsigned long prot;

/* Leave vm_pgoff as-is, the PCI space address is the physical
* address on this platform.
*/
prot = pgprot_val(vma->vm_page_prot);
vma->vm_page_prot = __pgprot(prot);

/* Write-combine setting is ignored, it is changed via the mtrr
* interfaces on this platform.
*/
if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
return -EAGAIN;

return 0;
}

resource_size_t
pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align)
Expand Down
1 change: 1 addition & 0 deletions arch/cris/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ struct pci_dev;
#define PCI_DMA_BUS_IS_PHYS (1)

#define HAVE_PCI_MMAP
#define ARCH_GENERIC_PCI_MMAP_RESOURCE

#endif /* __KERNEL__ */

Expand Down

0 comments on commit 3efdd5f

Please sign in to comment.