Skip to content

Commit b56f93f

Browse files
Giovanni Di Santihdeller
authored andcommitted
fbdev: kyro: Add missing PCI memory region request
The kyro framebuffer driver did not request its PCI memory regions, which could lead to conflicts with other drivers. This change addresses the task "Request memory regions in all fbdev drivers" from the file Documentation/gpu/todo.rst. This is addressed by using the managed device functions pcim_enable_device() and pcim_request_all_regions(). This simplifies the code by making error handling and driver removal cleanup automatic for these resources. Signed-off-by: Giovanni Di Santi <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent c80de50 commit b56f93f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/video/fbdev/kyro/fbdev.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
679679
if (err)
680680
return err;
681681

682-
if ((err = pci_enable_device(pdev))) {
682+
err = pcim_enable_device(pdev);
683+
if (err) {
683684
printk(KERN_WARNING "kyrofb: Can't enable pdev: %d\n", err);
684685
return err;
685686
}
@@ -688,6 +689,10 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
688689
if (!info)
689690
return -ENOMEM;
690691

692+
err = pcim_request_all_regions(pdev, "kyrofb");
693+
if (err)
694+
goto out_free_fb;
695+
691696
currentpar = info->par;
692697

693698
kyro_fix.smem_start = pci_resource_start(pdev, 0);

0 commit comments

Comments
 (0)