Skip to contentSkip to conversation

HID: sony: fix incorrect force-feedback check in sony_suspend()

PATCH Applied Rosalie Wanders 2 participants 2 messages Apr 10 – Apr 28 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: sony: fix incorrect force-feedback check in sony_suspend()

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.

---
 drivers/hid/hid-sony.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hid/hid-sony.c +2 -3
index 83e82a0a3327..9cfea6f40ec2 100644
@@ -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);
 	}
Signature · 1 line
2.53.0
maintainer Applied
#1 lore raw
Quoted 16 lines · Rosalie Wanders

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.

---
 drivers/hid/hid-sony.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hid/hid-sony.c +0 -0
index 83e82a0a3327..9cfea6f40ec2 100644
@@ -2456,11 +2456,10 @@ static void sony_remove(struct hid_device *hdev)
 static int sony_suspend(struct hid_device *hdev, pm_message_t message)
 {

drivers/hid/hid-sony.c static void sony_remove(struct hid_device *hdev) · line 2464

Quoted 10 lines
drivers/hid/hid-sony.c +2 -3
 #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);

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs