Skip to content

Commit

Permalink
Define LED_FUNCTION_PLAYER* if not defined (#1)
Browse files Browse the repository at this point in the history
This change adds some preprocessor defines that were added to the Linux
kernel in 5.16. We simply define them if they're not already defined.
Even if this somehow slightly changes compatibility somehow, it's
harmless. It just affects a device name. Maybe someone's udev rule would
break. But the chances are extremely remote for reasons I don't want to
belabor here.

Fixes #1.
  • Loading branch information
emilyst committed Jul 17, 2022
1 parent bf7d70e commit f6ff690
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hid-nx.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,15 @@ struct nx_con_input_report {

static const unsigned short NX_CON_RUMBLE_ZERO_AMP_PKT_CNT = 5;

/* for compat with kernels before 5.16 */
#ifndef LED_FUNCTION_PLAYER1
#define LED_FUNCTION_PLAYER1 "player-1"
#define LED_FUNCTION_PLAYER2 "player-2"
#define LED_FUNCTION_PLAYER3 "player-3"
#define LED_FUNCTION_PLAYER4 "player-4"
#define LED_FUNCTION_PLAYER5 "player-5"
#endif

static const char * nx_con_player_led_names[] = {
LED_FUNCTION_PLAYER1,
LED_FUNCTION_PLAYER2,
Expand Down

0 comments on commit f6ff690

Please sign in to comment.