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

fbdev: kyro: Use devm_ioremap() for mmio registers

Replace the manual ioremap() call for the MMIO registers with the
device-managed devm_ioremap() variant.

This simplifies the driver's resource management by ensuring the memory is
automatically unmapped when the driver detaches from the device.

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
e0bf12a4 b56f93f5

+3 -5
+3 -5
drivers/video/fbdev/kyro/fbdev.c
··· 701 701 kyro_fix.mmio_len = pci_resource_len(pdev, 1); 702 702 703 703 currentpar->regbase = deviceInfo.pSTGReg = 704 - ioremap(kyro_fix.mmio_start, kyro_fix.mmio_len); 704 + devm_ioremap(&pdev->dev, kyro_fix.mmio_start, 705 + kyro_fix.mmio_len); 705 706 if (!currentpar->regbase) 706 707 goto out_free_fb; 707 708 708 709 info->screen_base = pci_ioremap_wc_bar(pdev, 0); 709 710 if (!info->screen_base) 710 - goto out_unmap_regs; 711 + goto out_free_fb; 711 712 712 713 if (!nomtrr) 713 714 currentpar->wc_cookie = arch_phys_wc_add(kyro_fix.smem_start, ··· 756 755 757 756 out_unmap: 758 757 iounmap(info->screen_base); 759 - out_unmap_regs: 760 - iounmap(currentpar->regbase); 761 758 out_free_fb: 762 759 framebuffer_release(info); 763 760 ··· 778 779 deviceInfo.ulOverlayOffset = 0; 779 780 780 781 iounmap(info->screen_base); 781 - iounmap(par->regbase); 782 782 783 783 arch_phys_wc_del(par->wc_cookie); 784 784