Commit 9a31b381 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/via: Remove references to drm_device.pdev

Replace all references to struct drm_device's pdev field with
an upcast from dev.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210502104953.21768-7-tzimmermann@suse.de
parent e2c5ab5c
...@@ -494,6 +494,7 @@ via_dmablit_workqueue(struct work_struct *work) ...@@ -494,6 +494,7 @@ via_dmablit_workqueue(struct work_struct *work)
{ {
drm_via_blitq_t *blitq = container_of(work, drm_via_blitq_t, wq); drm_via_blitq_t *blitq = container_of(work, drm_via_blitq_t, wq);
struct drm_device *dev = blitq->dev; struct drm_device *dev = blitq->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
unsigned long irqsave; unsigned long irqsave;
drm_via_sg_info_t *cur_sg; drm_via_sg_info_t *cur_sg;
int cur_released; int cur_released;
...@@ -520,7 +521,7 @@ via_dmablit_workqueue(struct work_struct *work) ...@@ -520,7 +521,7 @@ via_dmablit_workqueue(struct work_struct *work)
wake_up(&blitq->busy_queue); wake_up(&blitq->busy_queue);
via_free_sg_info(dev->pdev, cur_sg); via_free_sg_info(pdev, cur_sg);
kfree(cur_sg); kfree(cur_sg);
spin_lock_irqsave(&blitq->blit_lock, irqsave); spin_lock_irqsave(&blitq->blit_lock, irqsave);
...@@ -540,9 +541,10 @@ via_init_dmablit(struct drm_device *dev) ...@@ -540,9 +541,10 @@ via_init_dmablit(struct drm_device *dev)
{ {
int i, j; int i, j;
drm_via_private_t *dev_priv = (drm_via_private_t *)dev->dev_private; drm_via_private_t *dev_priv = (drm_via_private_t *)dev->dev_private;
struct pci_dev *pdev = to_pci_dev(dev->dev);
drm_via_blitq_t *blitq; drm_via_blitq_t *blitq;
pci_set_master(dev->pdev); pci_set_master(pdev);
for (i = 0; i < VIA_NUM_BLIT_ENGINES; ++i) { for (i = 0; i < VIA_NUM_BLIT_ENGINES; ++i) {
blitq = dev_priv->blit_queues + i; blitq = dev_priv->blit_queues + i;
...@@ -573,6 +575,7 @@ via_init_dmablit(struct drm_device *dev) ...@@ -573,6 +575,7 @@ via_init_dmablit(struct drm_device *dev)
static int static int
via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer) via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
{ {
struct pci_dev *pdev = to_pci_dev(dev->dev);
int draw = xfer->to_fb; int draw = xfer->to_fb;
int ret = 0; int ret = 0;
...@@ -652,17 +655,17 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli ...@@ -652,17 +655,17 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
if (0 != (ret = via_lock_all_dma_pages(vsg, xfer))) { if (0 != (ret = via_lock_all_dma_pages(vsg, xfer))) {
DRM_ERROR("Could not lock DMA pages.\n"); DRM_ERROR("Could not lock DMA pages.\n");
via_free_sg_info(dev->pdev, vsg); via_free_sg_info(pdev, vsg);
return ret; return ret;
} }
via_map_blit_for_device(dev->pdev, xfer, vsg, 0); via_map_blit_for_device(pdev, xfer, vsg, 0);
if (0 != (ret = via_alloc_desc_pages(vsg))) { if (0 != (ret = via_alloc_desc_pages(vsg))) {
DRM_ERROR("Could not allocate DMA descriptor pages.\n"); DRM_ERROR("Could not allocate DMA descriptor pages.\n");
via_free_sg_info(dev->pdev, vsg); via_free_sg_info(pdev, vsg);
return ret; return ret;
} }
via_map_blit_for_device(dev->pdev, xfer, vsg, 1); via_map_blit_for_device(pdev, xfer, vsg, 1);
return 0; return 0;
} }
......
...@@ -98,6 +98,7 @@ int via_map_init(struct drm_device *dev, void *data, struct drm_file *file_priv) ...@@ -98,6 +98,7 @@ int via_map_init(struct drm_device *dev, void *data, struct drm_file *file_priv)
int via_driver_load(struct drm_device *dev, unsigned long chipset) int via_driver_load(struct drm_device *dev, unsigned long chipset)
{ {
struct pci_dev *pdev = to_pci_dev(dev->dev);
drm_via_private_t *dev_priv; drm_via_private_t *dev_priv;
int ret = 0; int ret = 0;
...@@ -110,7 +111,7 @@ int via_driver_load(struct drm_device *dev, unsigned long chipset) ...@@ -110,7 +111,7 @@ int via_driver_load(struct drm_device *dev, unsigned long chipset)
dev_priv->chipset = chipset; dev_priv->chipset = chipset;
pci_set_master(dev->pdev); pci_set_master(pdev);
ret = drm_vblank_init(dev, 1); ret = drm_vblank_init(dev, 1);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment