drm/radeon: Clean up pdev->dev instances in probe

Get a struct device pointer from the start and use it.

Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Daniel Palmer 2025-10-18 14:44:49 +09:00 committed by Alex Deucher
parent 3ac635367e
commit d0da43def2

View File

@ -262,6 +262,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
unsigned long flags = 0;
struct drm_device *ddev;
struct radeon_device *rdev;
struct device *dev = &pdev->dev;
const struct drm_format_info *format;
int ret;
@ -277,7 +278,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
case CHIP_VERDE:
case CHIP_OLAND:
case CHIP_HAINAN:
dev_info(&pdev->dev,
dev_info(dev,
"SI support disabled by module param\n");
return -ENODEV;
}
@ -289,7 +290,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
case CHIP_HAWAII:
case CHIP_KABINI:
case CHIP_MULLINS:
dev_info(&pdev->dev,
dev_info(dev,
"CIK support disabled by module param\n");
return -ENODEV;
}
@ -303,11 +304,11 @@ static int radeon_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;
rdev = devm_drm_dev_alloc(&pdev->dev, &kms_driver, typeof(*rdev), ddev);
rdev = devm_drm_dev_alloc(dev, &kms_driver, typeof(*rdev), ddev);
if (IS_ERR(rdev))
return PTR_ERR(rdev);
rdev->dev = &pdev->dev;
rdev->dev = dev;
rdev->pdev = pdev;
ddev = rdev_to_drm(rdev);
ddev->dev_private = rdev;