]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/pm: Use devm_i2c_add_adapter() in the V13 smu
authorRodrigo Siqueira <siqueira@igalia.com>
Wed, 10 Sep 2025 17:39:41 +0000 (11:39 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Sep 2025 21:47:38 +0000 (17:47 -0400)
commit4970883abd31e4da100a3bf73a74b41517fc552e
tree5f17e262c547507751113e05121c3c543146be44
parent13f785d37aea745de0e722c81ec67995456577fd
drm/amd/pm: Use devm_i2c_add_adapter() in the V13 smu

The I2C init for SMU_V13 uses i2c_add_adapter() and i2c_del_adapter(),
this commit replaces the use of these two functions with
devm_i2c_add_adapter(). Notice that SMU_V13 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/smu13/smu_v13_0_0_ppt.c