Skip to content

Commit

Permalink
drm/ast: Remove reference to struct drm_device.pdev
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
Thomas Zimmermann committed Apr 29, 2021
1 parent aec70c3 commit 0ecb518
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/gpu/drm/ast/ast_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
return ast;
dev = &ast->base;

dev->pdev = pdev;
pci_set_drvdata(pdev, dev);

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

/* map reserved buffer */
ast->dp501_fw_buf = NULL;
if (dev->vram_mm->vram_size < pci_resource_len(dev->pdev, 0)) {
ast->dp501_fw_buf = pci_iomap_range(dev->pdev, 0, dev->vram_mm->vram_size, 0);
if (dev->vram_mm->vram_size < pci_resource_len(pdev, 0)) {
ast->dp501_fw_buf = pci_iomap_range(pdev, 0, dev->vram_mm->vram_size, 0);
if (!ast->dp501_fw_buf)
drm_info(dev, "failed to map reserved buffer!\n");
}
Expand Down

0 comments on commit 0ecb518

Please sign in to comment.