]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/pm: Use devm_i2c_add_adapter() in the V14_0_2 smu
authorRodrigo Siqueira <siqueira@igalia.com>
Wed, 10 Sep 2025 17:39:43 +0000 (11:39 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Sep 2025 21:47:43 +0000 (17:47 -0400)
commit49e957b2899c2f1c4ea44527727e46923d057a86
tree188b2f4823fb8ac98d418ca4c0fe95ad35d4bff2
parentc32da00612baa106d7cfea707411b1510239e66a
drm/amd/pm: Use devm_i2c_add_adapter() in the V14_0_2 smu

The I2C init for V14_0_2 uses i2c_add_adapter() and i2c_del_adapter(),
this commit replaces the use of these two functions with
devm_i2c_add_adapter(). Notice that V14_0_2 init initializes multiple
I2C buses in a loop; if something goes wrong, the previous adapters are
removed, and the amdgpu load is interrupted. Since I2C init is required
for the correct load of amdgpu, it is safe to rely on
devm_i2c_add_adapter() to handle any previously initialized I2C adapter.

Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c