Commit b420fb8d authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/mga: Remove references to struct 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-3-tzimmermann@suse.de
parent 1d4f7d88
...@@ -389,6 +389,7 @@ int mga_freelist_put(struct drm_device *dev, struct drm_buf *buf) ...@@ -389,6 +389,7 @@ int mga_freelist_put(struct drm_device *dev, struct drm_buf *buf)
int mga_driver_load(struct drm_device *dev, unsigned long flags) int mga_driver_load(struct drm_device *dev, unsigned long flags)
{ {
struct pci_dev *pdev = to_pci_dev(dev->dev);
drm_mga_private_t *dev_priv; drm_mga_private_t *dev_priv;
int ret; int ret;
...@@ -400,9 +401,9 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -400,9 +401,9 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags)
* device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
* device. * device.
*/ */
if ((dev->pdev->device == 0x0525) && dev->pdev->bus->self if ((pdev->device == 0x0525) && pdev->bus->self
&& (dev->pdev->bus->self->vendor == 0x3388) && (pdev->bus->self->vendor == 0x3388)
&& (dev->pdev->bus->self->device == 0x0021) && (pdev->bus->self->device == 0x0021)
&& dev->agp) { && dev->agp) {
/* FIXME: This should be quirked in the pci core, but oh well /* FIXME: This should be quirked in the pci core, but oh well
* the hw probably stopped existing. */ * the hw probably stopped existing. */
...@@ -419,10 +420,10 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -419,10 +420,10 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags)
dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT; dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT;
dev_priv->chipset = flags; dev_priv->chipset = flags;
pci_set_master(dev->pdev); pci_set_master(pdev);
dev_priv->mmio_base = pci_resource_start(dev->pdev, 1); dev_priv->mmio_base = pci_resource_start(pdev, 1);
dev_priv->mmio_size = pci_resource_len(dev->pdev, 1); dev_priv->mmio_size = pci_resource_len(pdev, 1);
ret = drm_vblank_init(dev, 1); ret = drm_vblank_init(dev, 1);
......
...@@ -1005,6 +1005,7 @@ int mga_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv) ...@@ -1005,6 +1005,7 @@ int mga_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv)
{ {
drm_mga_private_t *dev_priv = dev->dev_private; drm_mga_private_t *dev_priv = dev->dev_private;
drm_mga_getparam_t *param = data; drm_mga_getparam_t *param = data;
struct pci_dev *pdev = to_pci_dev(dev->dev);
int value; int value;
if (!dev_priv) { if (!dev_priv) {
...@@ -1016,7 +1017,7 @@ int mga_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv) ...@@ -1016,7 +1017,7 @@ int mga_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv)
switch (param->param) { switch (param->param) {
case MGA_PARAM_IRQ_NR: case MGA_PARAM_IRQ_NR:
value = dev->pdev->irq; value = pdev->irq;
break; break;
case MGA_PARAM_CARD_TYPE: case MGA_PARAM_CARD_TYPE:
value = dev_priv->chipset; value = dev_priv->chipset;
......
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