History

fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers

Since commit b0e999c95581 ("fbdev: list all pci memory bars as conflicting apertures") the parameter was used for some sanity checks only, to make sure we detect any issues with the new approach to just list all memory bars as apertures. No issues turned up so far, so continue to cleanup: Drop the res_id parameter, drop the sanity checks. Also downgrade the logging from "info" level to "debug" level and update documentation.

Gerd Hoffmann committed 7 years ago

Commit 0a845961 parent e26ae7c3 files · +7 −14Browse files

Unified · Split

3 files
  1. drivers/video/fbdev/core/fbmem.c +5 −12
  2. include/drm/drm_fb_helper.h +1 −1
  3. include/linux/fb.h +1 −1
drivers/video/fbdev/core/fbmem.c+5−12
@@ -1758,21 +1758,19 @@ EXPORT_SYMBOL(remove_conflicting_framebuffers); · 1757 unmodified lines
17581758 /**
17591759 * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
17601760 * @pdev: PCI device
1761− * @res_id: index of PCI BAR configuring framebuffer memory
17621761 * @name: requesting driver name
17631762 *
17641763 * This function removes framebuffer devices (eg. initialized by firmware)
1765− * using memory range configured for @pdev's BAR @res_id.
1764+ * using memory range configured for any of @pdev's memory bars.
17661765 *
17671766 * The function assumes that PCI device with shadowed ROM drives a primary
17681767 * display and so kicks out vga16fb.
17691768 */
1770−int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
1769+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name)
17711770 {
17721771 struct apertures_struct *ap;
17731772 bool primary = false;
17741773 int err, idx, bar;
1775− bool res_id_found = false;
17761774
17771775 for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {
17781776 if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
@@ -1789,16 +1787,11 @@ int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const · 10 unmodified lines
17891787 continue;
17901788 ap->ranges[idx].base = pci_resource_start(pdev, bar);
17911789 ap->ranges[idx].size = pci_resource_len(pdev, bar);
1792− pci_info(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
1793− (unsigned long)pci_resource_start(pdev, bar),
1794− (unsigned long)pci_resource_end(pdev, bar));
1790+ pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
1791+ (unsigned long)pci_resource_start(pdev, bar),
1792+ (unsigned long)pci_resource_end(pdev, bar));
17951793 idx++;
1796− if (res_id == bar)
1797− res_id_found = true;
17981794 }
1799− if (!res_id_found)
1800− pci_warn(pdev, "%s: passed res_id (%d) is not a memory bar\n",
1801− __func__, res_id);
18021795
18031796 #ifdef CONFIG_X86
18041797 primary = pdev->resource[PCI_ROM_RESOURCE].flags &
include/drm/drm_fb_helper.h+1−1
@@ -560,7 +560,7 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, · 559 unmodified lines
560560 * otherwise the vga fbdev driver falls over.
561561 */
562562 #if IS_REACHABLE(CONFIG_FB)
563− ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
563+ ret = remove_conflicting_pci_framebuffers(pdev, name);
564564 #endif
565565 if (ret == 0)
566566 ret = vga_remove_vgacon(pdev);
include/linux/fb.h+1−1
@@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, · 606 unmodified lines
607607 extern int register_framebuffer(struct fb_info *fb_info);
608608 extern void unregister_framebuffer(struct fb_info *fb_info);
609609 extern void unlink_framebuffer(struct fb_info *fb_info);
610−extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
610+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
611611 const char *name);
612612 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
613613 const char *name, bool primary);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t