Skip to content

Commit 0ecb518

Browse files
author
Thomas Zimmermann
committed
drm/ast: Remove reference to struct drm_device.pdev
Using struct drm_device.pdev is deprecated. Upcast with to_pci_dev() from struct drm_device.dev to get the PCI device structure. v9: * fix remaining pdev references Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Michael J. Ruhl <[email protected]> Fixes: ba4e033 ("drm/ast: Fixed CVE for DP501") Cc: KuoHsiang Chou <[email protected]> Cc: kernel test robot <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Dave Airlie <[email protected]> Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent aec70c3 commit 0ecb518

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/ast/ast_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
411411
return ast;
412412
dev = &ast->base;
413413

414-
dev->pdev = pdev;
415414
pci_set_drvdata(pdev, dev);
416415

417416
ast->regs = pcim_iomap(pdev, 1, 0);
@@ -453,8 +452,8 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
453452

454453
/* map reserved buffer */
455454
ast->dp501_fw_buf = NULL;
456-
if (dev->vram_mm->vram_size < pci_resource_len(dev->pdev, 0)) {
457-
ast->dp501_fw_buf = pci_iomap_range(dev->pdev, 0, dev->vram_mm->vram_size, 0);
455+
if (dev->vram_mm->vram_size < pci_resource_len(pdev, 0)) {
456+
ast->dp501_fw_buf = pci_iomap_range(pdev, 0, dev->vram_mm->vram_size, 0);
458457
if (!ast->dp501_fw_buf)
459458
drm_info(dev, "failed to map reserved buffer!\n");
460459
}

0 commit comments

Comments
 (0)