diff --git a/input/udev_joypad.c b/input/udev_joypad.c index c1b69cdc80..9761ec593c 100644 --- a/input/udev_joypad.c +++ b/input/udev_joypad.c @@ -216,7 +216,7 @@ static bool udev_set_rumble(unsigned i, enum retro_rumble_effect effect, uint16_ // Setting at init seems to work for pads which are hotplugged ... // // This approach might be cleaner in the end if we end up supporting configurable force feedback. - if (!pad->has_set_ff[effect]) + if (!pad->has_set_ff[effect] && strength) { struct ff_effect e; memset(&e, 0, sizeof(e)); @@ -237,8 +237,8 @@ static bool udev_set_rumble(unsigned i, enum retro_rumble_effect effect, uint16_ pad->has_set_ff[effect] = true; pad->effects[effect] = e.id; - pad->strength[effect] = strength; } + pad->strength[effect] = strength; if (strength) { @@ -348,7 +348,6 @@ static int open_joystick(const char *path) if (fd < 0) return fd; - unsigned long evbit[NBITS(EV_MAX)] = {0}; unsigned long keybit[NBITS(KEY_MAX)] = {0}; unsigned long absbit[NBITS(ABS_MAX)] = {0}; @@ -362,7 +361,6 @@ static int open_joystick(const char *path) if (!test_bit(EV_KEY, evbit)) goto error; - return fd; error: @@ -402,7 +400,6 @@ static bool add_pad(unsigned i, int fd, const char *path) return false; } - RARCH_LOG("[udev]: Plugged pad: %s on port #%u.\n", pad->ident, i); struct stat st;