From: Michal MalĂ˝ Date: Wed, 8 Jul 2015 22:52:38 +0000 (+0200) Subject: Handle transition from STARTED to STOPPED correctly for combinable X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=0b7b482468b05a674c2393c7569ada24242b459c;p=KLGD_FF_plugin.git Handle transition from STARTED to STOPPED correctly for combinable effects. --- diff --git a/klgd_ff_plugin.c b/klgd_ff_plugin.c index c42183e..a6a3dde 100644 --- a/klgd_ff_plugin.c +++ b/klgd_ff_plugin.c @@ -163,11 +163,16 @@ static int ffpl_handle_combinable_effects(struct klgd_plugin_private *priv, stru needs_update = true; printk(KERN_NOTICE "KLGDFF: Altered combinable effect, total active effects %lu\n", active_effects); break; + case FFPL_TO_STOP: + if (eff->state == FFPL_STARTED) + needs_update = true; case FFPL_TO_UPLOAD: eff->state = FFPL_UPLOADED; - printk(KERN_NOTICE "KLGDFF: Combinable effect to upload, marking as uploaded\n"); + printk(KERN_NOTICE "KLGDFF: Combinable effect to upload/stop, marking as uploaded\n"); break; default: + if (eff->state != FFPL_STARTED) + break; needs_update = true; eff->state = FFPL_EMPTY; printk(KERN_NOTICE "KLGDFF: Stopped combinable effect, total active effects %lu\n", active_effects);