diff options
author | David Woodhouse <dwmw@amazon.co.uk> | 2017-04-12 08:26:01 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-04-20 09:47:47 -0400 |
commit | 3efdd5fe0a363e308ed61d020f14371dfb5aab4a (patch) | |
tree | 10c267a17abb17aad51aa6934fb8a4c7a354c139 | |
parent | 00d2904ffeac067d7fe29c04edcfa0216102b4c2 (diff) |
cris/PCI: Use generic pci_mmap_resource_range()
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>
-rw-r--r-- | arch/cris/arch-v32/drivers/pci/bios.c | 23 | ||||
-rw-r--r-- | arch/cris/include/asm/pci.h | 1 |
2 files changed, 1 insertions, 23 deletions
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c index a589686d5448..394c2a73d5e2 100644 --- a/arch/cris/arch-v32/drivers/pci/bios.c +++ b/arch/cris/arch-v32/drivers/pci/bios.c | |||
@@ -14,29 +14,6 @@ void pcibios_set_master(struct pci_dev *dev) | |||
14 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | 14 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); |
15 | } | 15 | } |
16 | 16 | ||
17 | int pci_mmap_page_range(struct pci_dev *dev, int bar, | ||
18 | struct vm_area_struct *vma, | ||
19 | enum pci_mmap_state mmap_state, int write_combine) | ||
20 | { | ||
21 | unsigned long prot; | ||
22 | |||
23 | /* Leave vm_pgoff as-is, the PCI space address is the physical | ||
24 | * address on this platform. | ||
25 | */ | ||
26 | prot = pgprot_val(vma->vm_page_prot); | ||
27 | vma->vm_page_prot = __pgprot(prot); | ||
28 | |||
29 | /* Write-combine setting is ignored, it is changed via the mtrr | ||
30 | * interfaces on this platform. | ||
31 | */ | ||
32 | if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | ||
33 | vma->vm_end - vma->vm_start, | ||
34 | vma->vm_page_prot)) | ||
35 | return -EAGAIN; | ||
36 | |||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | resource_size_t | 17 | resource_size_t |
41 | pcibios_align_resource(void *data, const struct resource *res, | 18 | pcibios_align_resource(void *data, const struct resource *res, |
42 | resource_size_t size, resource_size_t align) | 19 | resource_size_t size, resource_size_t align) |
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h index 65198cb46c85..6e505332b3e3 100644 --- a/arch/cris/include/asm/pci.h +++ b/arch/cris/include/asm/pci.h | |||
@@ -42,6 +42,7 @@ struct pci_dev; | |||
42 | #define PCI_DMA_BUS_IS_PHYS (1) | 42 | #define PCI_DMA_BUS_IS_PHYS (1) |
43 | 43 | ||
44 | #define HAVE_PCI_MMAP | 44 | #define HAVE_PCI_MMAP |
45 | #define ARCH_GENERIC_PCI_MMAP_RESOURCE | ||
45 | 46 | ||
46 | #endif /* __KERNEL__ */ | 47 | #endif /* __KERNEL__ */ |
47 | 48 | ||