aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/platform-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/platform-pci.c')
-rw-r--r--drivers/xen/platform-pci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 2f3528e93cb9..f1947ac218d9 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -108,6 +108,7 @@ static int platform_pci_init(struct pci_dev *pdev,
108 long ioaddr; 108 long ioaddr;
109 long mmio_addr, mmio_len; 109 long mmio_addr, mmio_len;
110 unsigned int max_nr_gframes; 110 unsigned int max_nr_gframes;
111 unsigned long grant_frames;
111 112
112 if (!xen_domain()) 113 if (!xen_domain())
113 return -ENODEV; 114 return -ENODEV;
@@ -154,13 +155,16 @@ static int platform_pci_init(struct pci_dev *pdev,
154 } 155 }
155 156
156 max_nr_gframes = gnttab_max_grant_frames(); 157 max_nr_gframes = gnttab_max_grant_frames();
157 xen_hvm_resume_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); 158 grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes);
159 if (gnttab_setup_auto_xlat_frames(grant_frames))
160 goto out;
158 ret = gnttab_init(); 161 ret = gnttab_init();
159 if (ret) 162 if (ret)
160 goto out; 163 goto grant_out;
161 xenbus_probe(NULL); 164 xenbus_probe(NULL);
162 return 0; 165 return 0;
163 166grant_out:
167 gnttab_free_auto_xlat_frames();
164out: 168out:
165 pci_release_region(pdev, 0); 169 pci_release_region(pdev, 0);
166mem_out: 170mem_out: