From: Daniel Palmer <daniel@0x0f.com>
To: alexander.deucher@amd.com, christian.koenig@amd.com,
airlied@gmail.com, simona@ffwll.ch, wuhoipok@gmail.com
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Daniel Palmer <daniel@0x0f.com>
Subject: [PATCH 1/3] drm/radeon: Clean up pdev->dev instances in probe
Date: Sat, 18 Oct 2025 14:44:49 +0900 [thread overview]
Message-ID: <20251018054451.259432-2-daniel@0x0f.com> (raw)
In-Reply-To: <20251018054451.259432-1-daniel@0x0f.com>
Get a struct device pointer from the start and use it.
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
drivers/gpu/drm/radeon/radeon_drv.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 88e821d67af7..eb5138da8d5b 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -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;
--
2.51.0
next prev parent reply other threads:[~2025-10-18 8:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 5:44 [PATCH 0/3] drm/radeon: fix up some badness when probe fails Daniel Palmer
2025-10-18 5:44 ` Daniel Palmer [this message]
2025-10-18 5:44 ` [PATCH 2/3] drm/radeon: Do not kfree() devres managed rdev Daniel Palmer
2025-10-18 5:44 ` [PATCH 3/3] drm/radeon: Remove calls to drm_put_dev() Daniel Palmer
2025-10-20 17:32 ` [PATCH 0/3] drm/radeon: fix up some badness when probe fails Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251018054451.259432-2-daniel@0x0f.com \
--to=daniel@0x0f.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=wuhoipok@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox