]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: sony: fix incorrect force-feedback check in sony_suspend()
authorRosalie Wanders <rosalie@mailbox.org>
Fri, 10 Apr 2026 19:53:54 +0000 (21:53 +0200)
committerJiri Kosina <jkosina@suse.com>
Tue, 28 Apr 2026 16:22:59 +0000 (18:22 +0200)
This commit fixes the incorrect force-feedback check in sony_suspend(),
without this the check will always be true due to checking a constant
define that is never 0.

Signed-off-by: Rosalie Wanders <rosalie@mailbox.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-sony.c

index b5e724676c1dea604214e8a4e6c07f5140fccc49..23db406092ef151da56dc8b6ec1d6530e2c8bae8 100644 (file)
@@ -2456,11 +2456,10 @@ static void sony_remove(struct hid_device *hdev)
 static int sony_suspend(struct hid_device *hdev, pm_message_t message)
 {
 #ifdef CONFIG_SONY_FF
+       struct sony_sc *sc = hid_get_drvdata(hdev);
 
        /* On suspend stop any running force-feedback events */
-       if (SONY_FF_SUPPORT) {
-               struct sony_sc *sc = hid_get_drvdata(hdev);
-
+       if (sc->quirks & SONY_FF_SUPPORT) {
                sc->left = sc->right = 0;
                sony_send_output_report(sc);
        }