From patchwork Mon Nov 22 23:09:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Duncan Laurie X-Patchwork-Id: 348601 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAMN8p11029920 for ; Mon, 22 Nov 2010 23:23:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757630Ab0KVXKJ (ORCPT ); Mon, 22 Nov 2010 18:10:09 -0500 Received: from smtp-out.google.com ([74.125.121.35]:30105 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756380Ab0KVXKI (ORCPT ); Mon, 22 Nov 2010 18:10:08 -0500 Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id oAMNA5jX028260; Mon, 22 Nov 2010 15:10:06 -0800 Received: from iceblink.mtv.corp.google.com (iceblink.mtv.corp.google.com [172.22.73.51]) by wpaz1.hot.corp.google.com with ESMTP id oAMNA4Np003461; Mon, 22 Nov 2010 15:10:04 -0800 Received: by iceblink.mtv.corp.google.com (Postfix, from userid 15035) id 380F932082; Mon, 22 Nov 2010 15:10:04 -0800 (PST) From: Duncan Laurie To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Duncan Laurie Subject: [PATCH] Input: serio - clear serio event queue after sysfs driver rebind Date: Mon, 22 Nov 2010 15:09:50 -0800 Message-Id: <1290467390-25302-1-git-send-email-dlaurie@chromium.org> X-Mailer: git-send-email 1.7.3.1 X-System-Of-Record: true Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Nov 2010 23:24:23 +0000 (UTC) diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 405bf21..a66307e 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -454,6 +454,7 @@ static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute * serio_disconnect_port(serio); error = serio_bind_driver(serio, to_serio_driver(drv)); put_driver(drv); + serio_remove_pending_events(serio); } else { error = -EINVAL; }