Skip to content

Commit

Permalink
fix bad logic in Sony LED suspend/resume path
Browse files Browse the repository at this point in the history
Thanks to @flibitijibibo for pointing out the problem.
  • Loading branch information
johnv-valve committed Jun 8, 2017
1 parent 5e1625e commit 2679c9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -2740,8 +2740,8 @@ static int sony_suspend(struct hid_device *hdev, pm_message_t message)
* On suspend save the current LED state,
* stop running force-feedback and blank the LEDS.
*/
if (SONY_LED_SUPPORT || SONY_FF_SUPPORT) {
struct sony_sc *sc = hid_get_drvdata(hdev);
struct sony_sc *sc = hid_get_drvdata(hdev);
if (sc->quirks & (SONY_LED_SUPPORT | SONY_FF_SUPPORT)) {

#ifdef CONFIG_SONY_FF
sc->left = sc->right = 0;
Expand All @@ -2760,8 +2760,8 @@ static int sony_suspend(struct hid_device *hdev, pm_message_t message)
static int sony_resume(struct hid_device *hdev)
{
/* Restore the state of controller LEDs on resume */
if (SONY_LED_SUPPORT) {
struct sony_sc *sc = hid_get_drvdata(hdev);
struct sony_sc *sc = hid_get_drvdata(hdev);
if (sc->quirks & SONY_LED_SUPPORT) {

memcpy(sc->led_state, sc->resume_led_state,
sizeof(sc->led_state));
Expand Down

0 comments on commit 2679c9f

Please sign in to comment.