aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorGiovanni Di Santi <giovanni.disanti.lkl@gmail.com>2025-07-09 11:53:52 +0200
committerHelge Deller <deller@gmx.de>2025-07-27 19:56:51 +0200
commitb56f93f568dc0214963d9d9d2fd2c992cf241c76 (patch)
tree8f5b9f06c5b88ea45e95f43e2d7e06774d7e4395 /drivers/video/fbdev
parentfbdev: simplefb: Use of_reserved_mem_region_to_resource() for "memory-region" (diff)
downloadlinux-b56f93f568dc0214963d9d9d2fd2c992cf241c76.tar.gz
linux-b56f93f568dc0214963d9d9d2fd2c992cf241c76.zip
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 <giovanni.disanti.lkl@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/kyro/fbdev.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c
index 08ee8baa79f8..86e5d60ed0ff 100644
--- a/drivers/video/fbdev/kyro/fbdev.c
+++ b/drivers/video/fbdev/kyro/fbdev.c
@@ -679,7 +679,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
return err;
- if ((err = pci_enable_device(pdev))) {
+ err = pcim_enable_device(pdev);
+ if (err) {
printk(KERN_WARNING "kyrofb: Can't enable pdev: %d\n", err);
return err;
}
@@ -688,6 +689,10 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (!info)
return -ENOMEM;
+ err = pcim_request_all_regions(pdev, "kyrofb");
+ if (err)
+ goto out_free_fb;
+
currentpar = info->par;
kyro_fix.smem_start = pci_resource_start(pdev, 0);