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

drm/vboxvideo: Use managed VRAM-helper initialization

updated to use drmm_vram_helper_init().

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1614735587-6621-1-git-send-email-tiantao6@hisilicon.com

authored by

Tian Tao and committed by
Daniel Vetter
429fc6f9 b603e810

+2 -5
+2 -5
drivers/gpu/drm/vboxvideo/vbox_ttm.c
··· 12 12 13 13 int vbox_mm_init(struct vbox_private *vbox) 14 14 { 15 - struct drm_vram_mm *vmm; 16 15 int ret; 17 16 struct drm_device *dev = &vbox->ddev; 18 17 struct pci_dev *pdev = to_pci_dev(dev->dev); 19 18 20 - vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0), 19 + ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0), 21 20 vbox->available_vram_size); 22 - if (IS_ERR(vmm)) { 23 - ret = PTR_ERR(vmm); 21 + if (ret) { 24 22 DRM_ERROR("Error initializing VRAM MM; %d\n", ret); 25 23 return ret; 26 24 } ··· 31 33 void vbox_mm_fini(struct vbox_private *vbox) 32 34 { 33 35 arch_phys_wc_del(vbox->fb_mtrr); 34 - drm_vram_helper_release_mm(&vbox->ddev); 35 36 }