HID: amd_sfh: Fix SRA sensor when it's the only sensor
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 21 Apr 2025 21:32:09 +0000 (16:32 -0500)
committerJiri Kosina <jkosina@suse.com>
Thu, 24 Apr 2025 10:17:55 +0000 (12:17 +0200)
commit0cc2effbc8f522af6b9d871cd27678e6aed9d56c
tree789f0cb23a3fa286315c8fe84c722fe5d50b5519
parent6bf8ab7774a20e1e60030e20f42ac8cc804fa457
HID: amd_sfh: Fix SRA sensor when it's the only sensor

On systems that only have an SRA sensor connected to SFH the sensor
doesn't get enabled due to a bad optimization condition of breaking
the sensor walk loop.

This optimization is unnecessary in the first place because if there
is only one device then the loop only runs once. Drop the condition
and explicitly mark sensor as enabled.

Reported-by: Yijun Shen <Yijun.Shen@dell.com>
Tested-By: Yijun Shen <Yijun_Shen@Dell.com>
Fixes: d1c444b47100d ("HID: amd_sfh: Add support to export device operating states")
Cc: stable@vger.kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c