mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	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. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
		
							parent
							
								
									52215e2a5d
								
							
						
					
					
						commit
						e5a7d047f4
					
				
					 1 changed files with 2 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue