Skip to content

Commit 63137c7

Browse files
rodrigosiqueiraalexdeucher
authored andcommitted
drm/amdgpu: Use devm_i2c_add_adapter() in SMU V11
Instead of using i2c_add_adapter() and i2c_del_adapter() in the SMU V11, use devm_i2c_add_adapter() to simplify the code path. Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 0f36a3c commit 63137c7

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ int smu_v11_0_i2c_control_init(struct amdgpu_device *adev)
743743
adev->pm.ras_eeprom_i2c_bus = &adev->pm.smu_i2c[0].adapter;
744744
adev->pm.fru_eeprom_i2c_bus = &adev->pm.smu_i2c[0].adapter;
745745

746-
res = i2c_add_adapter(control);
746+
res = devm_i2c_add_adapter(adev->dev, control);
747747
if (res)
748748
DRM_ERROR("Failed to register hw i2c, err: %d\n", res);
749749

@@ -752,9 +752,6 @@ int smu_v11_0_i2c_control_init(struct amdgpu_device *adev)
752752

753753
void smu_v11_0_i2c_control_fini(struct amdgpu_device *adev)
754754
{
755-
struct i2c_adapter *control = adev->pm.ras_eeprom_i2c_bus;
756-
757-
i2c_del_adapter(control);
758755
adev->pm.ras_eeprom_i2c_bus = NULL;
759756
adev->pm.fru_eeprom_i2c_bus = NULL;
760757
}

0 commit comments

Comments
 (0)