[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230104164042.30271-41-mario.limonciello@amd.com>
Date: Wed, 4 Jan 2023 10:40:29 -0600
From: Mario Limonciello <mario.limonciello@....com>
To: Alex Deucher <alexander.deucher@....com>,
<linux-kernel@...r.kernel.org>
CC: Javier Martinez Canillas <javierm@...hat.com>,
Carlos Soriano Sanchez <csoriano@...hat.com>,
<amd-gfx@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>,
David Airlie <airlied@...il.com>,
"Daniel Vetter" <daniel@...ll.ch>, <christian.koenig@....com>,
Lazar Lijo <Lijo.Lazar@....com>,
Mario Limonciello <mario.limonciello@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>
Subject: [PATCH v5 40/45] drm/amd: Use `amdgpu_ucode_*` helpers for CGS
The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.
The `amdgpu_ucode_release` helper is for symmetry on unloading.
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index f1a050379190..151a313fc2a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -411,17 +411,10 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
return -EINVAL;
}
- err = request_firmware(&adev->pm.fw, fw_name, adev->dev);
- if (err) {
- DRM_ERROR("Failed to request firmware\n");
- return err;
- }
-
- err = amdgpu_ucode_validate(adev->pm.fw);
+ err = amdgpu_ucode_request(adev, &adev->pm.fw, fw_name);
if (err) {
DRM_ERROR("Failed to load firmware \"%s\"", fw_name);
- release_firmware(adev->pm.fw);
- adev->pm.fw = NULL;
+ amdgpu_ucode_release(adev->pm.fw);
return err;
}
--
2.34.1
Powered by blists - more mailing lists