Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Giovanni Di Santi and committed by
Helge Deller
b56f93f5 c80de50c

+6 -1
+6 -1
drivers/video/fbdev/kyro/fbdev.c
··· 679 679 if (err) 680 680 return err; 681 681 682 - if ((err = pci_enable_device(pdev))) { 682 + err = pcim_enable_device(pdev); 683 + if (err) { 683 684 printk(KERN_WARNING "kyrofb: Can't enable pdev: %d\n", err); 684 685 return err; 685 686 } ··· 688 687 info = framebuffer_alloc(sizeof(struct kyrofb_info), &pdev->dev); 689 688 if (!info) 690 689 return -ENOMEM; 690 + 691 + err = pcim_request_all_regions(pdev, "kyrofb"); 692 + if (err) 693 + goto out_free_fb; 691 694 692 695 currentpar = info->par; 693 696