aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/host/pci-host-generic.c2
-rw-r--r--drivers/pci/host/pci-mvebu.c2
-rw-r--r--drivers/pci/host/pci-tegra.c2
-rw-r--r--drivers/pci/host/pcie-rcar.c2
-rw-r--r--drivers/pci/msi.c84
-rw-r--r--drivers/pci/pci.c19
-rw-r--r--drivers/pci/setup-bus.c2
-rw-r--r--drivers/pci/setup-res.c75
-rw-r--r--drivers/video/fbdev/efifb.c39
9 files changed, 92 insertions, 135 deletions
diff --git a/drivers/pci/host/pci-host-generic.c b/drivers/pci/host/pci-host-generic.c
index 44fe6aa6a43f..3d2076f59911 100644
--- a/drivers/pci/host/pci-host-generic.c
+++ b/drivers/pci/host/pci-host-generic.c
@@ -385,4 +385,4 @@ module_platform_driver(gen_pci_driver);
385 385
386MODULE_DESCRIPTION("Generic PCI host driver"); 386MODULE_DESCRIPTION("Generic PCI host driver");
387MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>"); 387MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
388MODULE_LICENSE("GPLv2"); 388MODULE_LICENSE("GPL v2");
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index ce23e0f076b6..a8c6f1a92e0f 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -1094,4 +1094,4 @@ module_platform_driver(mvebu_pcie_driver);
1094 1094
1095MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>"); 1095MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
1096MODULE_DESCRIPTION("Marvell EBU PCIe driver"); 1096MODULE_DESCRIPTION("Marvell EBU PCIe driver");
1097MODULE_LICENSE("GPLv2"); 1097MODULE_LICENSE("GPL v2");
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 083cf37ca047..c284e841e3ea 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1716,4 +1716,4 @@ module_platform_driver(tegra_pcie_driver);
1716 1716
1717MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>"); 1717MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
1718MODULE_DESCRIPTION("NVIDIA Tegra PCIe driver"); 1718MODULE_DESCRIPTION("NVIDIA Tegra PCIe driver");
1719MODULE_LICENSE("GPLv2"); 1719MODULE_LICENSE("GPL v2");
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index f033972da9b9..4884ee5e07d4 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -989,4 +989,4 @@ module_platform_driver(rcar_pcie_driver);
989 989
990MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>"); 990MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
991MODULE_DESCRIPTION("Renesas R-Car PCIe driver"); 991MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
992MODULE_LICENSE("GPLv2"); 992MODULE_LICENSE("GPL v2");
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 50a7e4e96da7..5a40516444f3 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -235,7 +235,7 @@ static void msi_set_mask_bit(struct irq_data *data, u32 flag)
235 msix_mask_irq(desc, flag); 235 msix_mask_irq(desc, flag);
236 readl(desc->mask_base); /* Flush write to device */ 236 readl(desc->mask_base); /* Flush write to device */
237 } else { 237 } else {
238 unsigned offset = data->irq - desc->dev->irq; 238 unsigned offset = data->irq - desc->irq;
239 msi_mask_irq(desc, 1 << offset, flag << offset); 239 msi_mask_irq(desc, 1 << offset, flag << offset);
240 } 240 }
241} 241}
@@ -463,7 +463,6 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
463 if (!dev->msix_enabled) 463 if (!dev->msix_enabled)
464 return; 464 return;
465 BUG_ON(list_empty(&dev->msi_list)); 465 BUG_ON(list_empty(&dev->msi_list));
466 entry = list_first_entry(&dev->msi_list, struct msi_desc, list);
467 466
468 /* route the table */ 467 /* route the table */
469 pci_intx_for_msi(dev, 0); 468 pci_intx_for_msi(dev, 0);
@@ -488,7 +487,6 @@ EXPORT_SYMBOL_GPL(pci_restore_msi_state);
488static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr, 487static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
489 char *buf) 488 char *buf)
490{ 489{
491 struct pci_dev *pdev = to_pci_dev(dev);
492 struct msi_desc *entry; 490 struct msi_desc *entry;
493 unsigned long irq; 491 unsigned long irq;
494 int retval; 492 int retval;
@@ -497,12 +495,11 @@ static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
497 if (retval) 495 if (retval)
498 return retval; 496 return retval;
499 497
500 list_for_each_entry(entry, &pdev->msi_list, list) { 498 entry = irq_get_msi_desc(irq);
501 if (entry->irq == irq) { 499 if (entry)
502 return sprintf(buf, "%s\n", 500 return sprintf(buf, "%s\n",
503 entry->msi_attrib.is_msix ? "msix" : "msi"); 501 entry->msi_attrib.is_msix ? "msix" : "msi");
504 } 502
505 }
506 return -ENODEV; 503 return -ENODEV;
507} 504}
508 505
@@ -581,6 +578,38 @@ error_attrs:
581 return ret; 578 return ret;
582} 579}
583 580
581static struct msi_desc *msi_setup_entry(struct pci_dev *dev)
582{
583 u16 control;
584 struct msi_desc *entry;
585
586 /* MSI Entry Initialization */
587 entry = alloc_msi_entry(dev);
588 if (!entry)
589 return NULL;
590
591 pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
592
593 entry->msi_attrib.is_msix = 0;
594 entry->msi_attrib.is_64 = !!(control & PCI_MSI_FLAGS_64BIT);
595 entry->msi_attrib.entry_nr = 0;
596 entry->msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
597 entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */
598 entry->msi_attrib.pos = dev->msi_cap;
599 entry->msi_attrib.multi_cap = (control & PCI_MSI_FLAGS_QMASK) >> 1;
600
601 if (control & PCI_MSI_FLAGS_64BIT)
602 entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_64;
603 else
604 entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_32;
605
606 /* Save the initial mask status */
607 if (entry->msi_attrib.maskbit)
608 pci_read_config_dword(dev, entry->mask_pos, &entry->masked);
609
610 return entry;
611}
612
584/** 613/**
585 * msi_capability_init - configure device's MSI capability structure 614 * msi_capability_init - configure device's MSI capability structure
586 * @dev: pointer to the pci_dev data structure of MSI device function 615 * @dev: pointer to the pci_dev data structure of MSI device function
@@ -596,32 +625,15 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
596{ 625{
597 struct msi_desc *entry; 626 struct msi_desc *entry;
598 int ret; 627 int ret;
599 u16 control;
600 unsigned mask; 628 unsigned mask;
601 629
602 msi_set_enable(dev, 0); /* Disable MSI during set up */ 630 msi_set_enable(dev, 0); /* Disable MSI during set up */
603 631
604 pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); 632 entry = msi_setup_entry(dev);
605 /* MSI Entry Initialization */
606 entry = alloc_msi_entry(dev);
607 if (!entry) 633 if (!entry)
608 return -ENOMEM; 634 return -ENOMEM;
609 635
610 entry->msi_attrib.is_msix = 0;
611 entry->msi_attrib.is_64 = !!(control & PCI_MSI_FLAGS_64BIT);
612 entry->msi_attrib.entry_nr = 0;
613 entry->msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
614 entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */
615 entry->msi_attrib.pos = dev->msi_cap;
616 entry->msi_attrib.multi_cap = (control & PCI_MSI_FLAGS_QMASK) >> 1;
617
618 if (control & PCI_MSI_FLAGS_64BIT)
619 entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_64;
620 else
621 entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_32;
622 /* All MSIs are unmasked by default, Mask them all */ 636 /* All MSIs are unmasked by default, Mask them all */
623 if (entry->msi_attrib.maskbit)
624 pci_read_config_dword(dev, entry->mask_pos, &entry->masked);
625 mask = msi_mask(entry->msi_attrib.multi_cap); 637 mask = msi_mask(entry->msi_attrib.multi_cap);
626 msi_mask_irq(entry, mask, mask); 638 msi_mask_irq(entry, mask, mask);
627 639
@@ -999,24 +1011,6 @@ void pci_disable_msix(struct pci_dev *dev)
999} 1011}
1000EXPORT_SYMBOL(pci_disable_msix); 1012EXPORT_SYMBOL(pci_disable_msix);
1001 1013
1002/**
1003 * msi_remove_pci_irq_vectors - reclaim MSI(X) irqs to unused state
1004 * @dev: pointer to the pci_dev data structure of MSI(X) device function
1005 *
1006 * Being called during hotplug remove, from which the device function
1007 * is hot-removed. All previous assigned MSI/MSI-X irqs, if
1008 * allocated for this device function, are reclaimed to unused state,
1009 * which may be used later on.
1010 **/
1011void msi_remove_pci_irq_vectors(struct pci_dev *dev)
1012{
1013 if (!pci_msi_enable || !dev)
1014 return;
1015
1016 if (dev->msi_enabled || dev->msix_enabled)
1017 free_msi_irqs(dev);
1018}
1019
1020void pci_no_msi(void) 1014void pci_no_msi(void)
1021{ 1015{
1022 pci_msi_enable = 0; 1016 pci_msi_enable = 0;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 63a54a340863..74043a2a2da8 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -839,12 +839,6 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
839 839
840 if (!__pci_complete_power_transition(dev, state)) 840 if (!__pci_complete_power_transition(dev, state))
841 error = 0; 841 error = 0;
842 /*
843 * When aspm_policy is "powersave" this call ensures
844 * that ASPM is configured.
845 */
846 if (!error && dev->bus->self)
847 pcie_aspm_powersave_config_link(dev->bus->self);
848 842
849 return error; 843 return error;
850} 844}
@@ -1195,12 +1189,18 @@ int __weak pcibios_enable_device(struct pci_dev *dev, int bars)
1195static int do_pci_enable_device(struct pci_dev *dev, int bars) 1189static int do_pci_enable_device(struct pci_dev *dev, int bars)
1196{ 1190{
1197 int err; 1191 int err;
1192 struct pci_dev *bridge;
1198 u16 cmd; 1193 u16 cmd;
1199 u8 pin; 1194 u8 pin;
1200 1195
1201 err = pci_set_power_state(dev, PCI_D0); 1196 err = pci_set_power_state(dev, PCI_D0);
1202 if (err < 0 && err != -EIO) 1197 if (err < 0 && err != -EIO)
1203 return err; 1198 return err;
1199
1200 bridge = pci_upstream_bridge(dev);
1201 if (bridge)
1202 pcie_aspm_powersave_config_link(bridge);
1203
1204 err = pcibios_enable_device(dev, bars); 1204 err = pcibios_enable_device(dev, bars);
1205 if (err < 0) 1205 if (err < 0)
1206 return err; 1206 return err;
@@ -3193,7 +3193,7 @@ static int pci_pm_reset(struct pci_dev *dev, int probe)
3193 return 0; 3193 return 0;
3194} 3194}
3195 3195
3196void __weak pcibios_reset_secondary_bus(struct pci_dev *dev) 3196void pci_reset_secondary_bus(struct pci_dev *dev)
3197{ 3197{
3198 u16 ctrl; 3198 u16 ctrl;
3199 3199
@@ -3219,6 +3219,11 @@ void __weak pcibios_reset_secondary_bus(struct pci_dev *dev)
3219 ssleep(1); 3219 ssleep(1);
3220} 3220}
3221 3221
3222void __weak pcibios_reset_secondary_bus(struct pci_dev *dev)
3223{
3224 pci_reset_secondary_bus(dev);
3225}
3226
3222/** 3227/**
3223 * pci_reset_bridge_secondary_bus - Reset the secondary bus on a PCI bridge. 3228 * pci_reset_bridge_secondary_bus - Reset the secondary bus on a PCI bridge.
3224 * @dev: Bridge device 3229 * @dev: Bridge device
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index a5a63ecfb628..6373985ad3f7 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -925,7 +925,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
925{ 925{
926 struct pci_dev *dev; 926 struct pci_dev *dev;
927 resource_size_t min_align, align, size, size0, size1; 927 resource_size_t min_align, align, size, size0, size1;
928 resource_size_t aligns[14]; /* Alignments from 1Mb to 8Gb */ 928 resource_size_t aligns[18]; /* Alignments from 1Mb to 128Gb */
929 int order, max_order; 929 int order, max_order;
930 struct resource *b_res = find_free_bus_resource(bus, 930 struct resource *b_res = find_free_bus_resource(bus,
931 mask | IORESOURCE_PREFETCH, type); 931 mask | IORESOURCE_PREFETCH, type);
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index caed1ce6facd..b7c3a5ea1fca 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -166,11 +166,10 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
166{ 166{
167 struct resource *root, *conflict; 167 struct resource *root, *conflict;
168 resource_size_t fw_addr, start, end; 168 resource_size_t fw_addr, start, end;
169 int ret = 0;
170 169
171 fw_addr = pcibios_retrieve_fw_addr(dev, resno); 170 fw_addr = pcibios_retrieve_fw_addr(dev, resno);
172 if (!fw_addr) 171 if (!fw_addr)
173 return 1; 172 return -ENOMEM;
174 173
175 start = res->start; 174 start = res->start;
176 end = res->end; 175 end = res->end;
@@ -189,14 +188,13 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
189 resno, res); 188 resno, res);
190 conflict = request_resource_conflict(root, res); 189 conflict = request_resource_conflict(root, res);
191 if (conflict) { 190 if (conflict) {
192 dev_info(&dev->dev, 191 dev_info(&dev->dev, "BAR %d: %pR conflicts with %s %pR\n",
193 "BAR %d: %pR conflicts with %s %pR\n", resno, 192 resno, res, conflict->name, conflict);
194 res, conflict->name, conflict);
195 res->start = start; 193 res->start = start;
196 res->end = end; 194 res->end = end;
197 ret = 1; 195 return -EBUSY;
198 } 196 }
199 return ret; 197 return 0;
200} 198}
201 199
202static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, 200static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
@@ -250,10 +248,8 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
250static int _pci_assign_resource(struct pci_dev *dev, int resno, 248static int _pci_assign_resource(struct pci_dev *dev, int resno,
251 resource_size_t size, resource_size_t min_align) 249 resource_size_t size, resource_size_t min_align)
252{ 250{
253 struct resource *res = dev->resource + resno;
254 struct pci_bus *bus; 251 struct pci_bus *bus;
255 int ret; 252 int ret;
256 char *type;
257 253
258 bus = dev->bus; 254 bus = dev->bus;
259 while ((ret = __pci_assign_resource(bus, dev, resno, size, min_align))) { 255 while ((ret = __pci_assign_resource(bus, dev, resno, size, min_align))) {
@@ -262,21 +258,6 @@ static int _pci_assign_resource(struct pci_dev *dev, int resno,
262 bus = bus->parent; 258 bus = bus->parent;
263 } 259 }
264 260
265 if (ret) {
266 if (res->flags & IORESOURCE_MEM)
267 if (res->flags & IORESOURCE_PREFETCH)
268 type = "mem pref";
269 else
270 type = "mem";
271 else if (res->flags & IORESOURCE_IO)
272 type = "io";
273 else
274 type = "unknown";
275 dev_info(&dev->dev,
276 "BAR %d: can't assign %s (size %#llx)\n",
277 resno, type, (unsigned long long) resource_size(res));
278 }
279
280 return ret; 261 return ret;
281} 262}
282 263
@@ -302,17 +283,24 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
302 * where firmware left it. That at least has a chance of 283 * where firmware left it. That at least has a chance of
303 * working, which is better than just leaving it disabled. 284 * working, which is better than just leaving it disabled.
304 */ 285 */
305 if (ret < 0) 286 if (ret < 0) {
287 dev_info(&dev->dev, "BAR %d: no space for %pR\n", resno, res);
306 ret = pci_revert_fw_address(res, dev, resno, size); 288 ret = pci_revert_fw_address(res, dev, resno, size);
289 }
307 290
308 if (!ret) { 291 if (ret < 0) {
309 res->flags &= ~IORESOURCE_UNSET; 292 dev_info(&dev->dev, "BAR %d: failed to assign %pR\n", resno,
310 res->flags &= ~IORESOURCE_STARTALIGN; 293 res);
311 dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); 294 return ret;
312 if (resno < PCI_BRIDGE_RESOURCES)
313 pci_update_resource(dev, resno);
314 } 295 }
315 return ret; 296
297 res->flags &= ~IORESOURCE_UNSET;
298 res->flags &= ~IORESOURCE_STARTALIGN;
299 dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res);
300 if (resno < PCI_BRIDGE_RESOURCES)
301 pci_update_resource(dev, resno);
302
303 return 0;
316} 304}
317EXPORT_SYMBOL(pci_assign_resource); 305EXPORT_SYMBOL(pci_assign_resource);
318 306
@@ -320,9 +308,11 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
320 resource_size_t min_align) 308 resource_size_t min_align)
321{ 309{
322 struct resource *res = dev->resource + resno; 310 struct resource *res = dev->resource + resno;
311 unsigned long flags;
323 resource_size_t new_size; 312 resource_size_t new_size;
324 int ret; 313 int ret;
325 314
315 flags = res->flags;
326 res->flags |= IORESOURCE_UNSET; 316 res->flags |= IORESOURCE_UNSET;
327 if (!res->parent) { 317 if (!res->parent) {
328 dev_info(&dev->dev, "BAR %d: can't reassign an unassigned resource %pR\n", 318 dev_info(&dev->dev, "BAR %d: can't reassign an unassigned resource %pR\n",
@@ -333,14 +323,21 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
333 /* already aligned with min_align */ 323 /* already aligned with min_align */
334 new_size = resource_size(res) + addsize; 324 new_size = resource_size(res) + addsize;
335 ret = _pci_assign_resource(dev, resno, new_size, min_align); 325 ret = _pci_assign_resource(dev, resno, new_size, min_align);
336 if (!ret) { 326 if (ret) {
337 res->flags &= ~IORESOURCE_UNSET; 327 res->flags = flags;
338 res->flags &= ~IORESOURCE_STARTALIGN; 328 dev_info(&dev->dev, "BAR %d: %pR (failed to expand by %#llx)\n",
339 dev_info(&dev->dev, "BAR %d: reassigned %pR\n", resno, res); 329 resno, res, (unsigned long long) addsize);
340 if (resno < PCI_BRIDGE_RESOURCES) 330 return ret;
341 pci_update_resource(dev, resno);
342 } 331 }
343 return ret; 332
333 res->flags &= ~IORESOURCE_UNSET;
334 res->flags &= ~IORESOURCE_STARTALIGN;
335 dev_info(&dev->dev, "BAR %d: reassigned %pR (expanded by %#llx)\n",
336 resno, res, (unsigned long long) addsize);
337 if (resno < PCI_BRIDGE_RESOURCES)
338 pci_update_resource(dev, resno);
339
340 return 0;
344} 341}
345 342
346int pci_enable_resources(struct pci_dev *dev, int mask) 343int pci_enable_resources(struct pci_dev *dev, int mask)
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index ae9618ff6735..982f6abe6faf 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -19,8 +19,6 @@
19 19
20static bool request_mem_succeeded = false; 20static bool request_mem_succeeded = false;
21 21
22static struct pci_dev *default_vga;
23
24static struct fb_var_screeninfo efifb_defined = { 22static struct fb_var_screeninfo efifb_defined = {
25 .activate = FB_ACTIVATE_NOW, 23 .activate = FB_ACTIVATE_NOW,
26 .height = -1, 24 .height = -1,
@@ -84,23 +82,10 @@ static struct fb_ops efifb_ops = {
84 .fb_imageblit = cfb_imageblit, 82 .fb_imageblit = cfb_imageblit,
85}; 83};
86 84
87struct pci_dev *vga_default_device(void)
88{
89 return default_vga;
90}
91
92EXPORT_SYMBOL_GPL(vga_default_device);
93
94void vga_set_default_device(struct pci_dev *pdev)
95{
96 default_vga = pdev;
97}
98
99static int efifb_setup(char *options) 85static int efifb_setup(char *options)
100{ 86{
101 char *this_opt; 87 char *this_opt;
102 int i; 88 int i;
103 struct pci_dev *dev = NULL;
104 89
105 if (options && *options) { 90 if (options && *options) {
106 while ((this_opt = strsep(&options, ",")) != NULL) { 91 while ((this_opt = strsep(&options, ",")) != NULL) {
@@ -126,30 +111,6 @@ static int efifb_setup(char *options)
126 } 111 }
127 } 112 }
128 113
129 for_each_pci_dev(dev) {
130 int i;
131
132 if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
133 continue;
134
135 for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
136 resource_size_t start, end;
137
138 if (!(pci_resource_flags(dev, i) & IORESOURCE_MEM))
139 continue;
140
141 start = pci_resource_start(dev, i);
142 end = pci_resource_end(dev, i);
143
144 if (!start || !end)
145 continue;
146
147 if (screen_info.lfb_base >= start &&
148 (screen_info.lfb_base + screen_info.lfb_size) < end)
149 default_vga = dev;
150 }
151 }
152
153 return 0; 114 return 0;
154} 115}
155 116