Skip to content

Commit

Permalink
xpadneo: Fix missing report check
Browse files Browse the repository at this point in the history
This fix ensures that the missing_reported flag is correctly updated when the keyboard or gamepad is not detected.

Signed-off-by: Jun Yan <[email protected]>
  • Loading branch information
yjun123 authored and kakra committed Apr 21, 2024
1 parent be25f7b commit 93c76df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hid-xpadneo/src/hid-xpadneo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
return 0;

keyboard_missing:
if ((xdata->missing_reported && XPADNEO_MISSING_KEYBOARD) == 0) {
if ((xdata->missing_reported & XPADNEO_MISSING_KEYBOARD) == 0) {
xdata->missing_reported |= XPADNEO_MISSING_KEYBOARD;
hid_err(hdev, "keyboard not detected\n");
}
Expand All @@ -1028,7 +1028,7 @@ static int xpadneo_init_hw(struct hid_device *hdev)
struct xpadneo_devdata *xdata = hid_get_drvdata(hdev);

if (!xdata->gamepad) {
if ((xdata->missing_reported && XPADNEO_MISSING_GAMEPAD) == 0) {
if ((xdata->missing_reported & XPADNEO_MISSING_GAMEPAD) == 0) {
xdata->missing_reported |= XPADNEO_MISSING_GAMEPAD;
hid_err(hdev, "gamepad not detected\n");
}
Expand Down

0 comments on commit 93c76df

Please sign in to comment.