From patchwork Sun Jan 30 12:38:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Achatz X-Patchwork-Id: 517731 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 p0UCdJLt003905 for ; Sun, 30 Jan 2011 12:40:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754094Ab1A3MjL (ORCPT ); Sun, 30 Jan 2011 07:39:11 -0500 Received: from mail-in-01.arcor-online.net ([151.189.21.41]:60180 "EHLO mail-in-01.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754253Ab1A3Mij (ORCPT ); Sun, 30 Jan 2011 07:38:39 -0500 Received: from mail-in-21-z2.arcor-online.net (unknown [151.189.8.185]) by mx.arcor.de (Postfix) with ESMTP id EAF7B5A222; Sun, 30 Jan 2011 13:38:37 +0100 (CET) Received: from mail-in-15.arcor-online.net (mail-in-15.arcor-online.net [151.189.21.55]) by mail-in-21-z2.arcor-online.net (Postfix) with ESMTP id C64C9EDB87; Sun, 30 Jan 2011 13:38:37 +0100 (CET) Received: from [192.168.0.7] (dslb-084-057-063-232.pools.arcor-ip.net [84.57.63.232]) (Authenticated sender: screamingfist@arcor.de) by mail-in-15.arcor-online.net (Postfix) with ESMTPSA id 253001AB5F8; Sun, 30 Jan 2011 13:38:37 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-15.arcor-online.net 253001AB5F8 Subject: [PATCH 8/8] HID: roccat: Fixed bug that prevented roccat chardev from removing devices From: Stefan Achatz Reply-To: erazor_de@users.sourceforge.net To: Randy Dunlap , Jiri Kosina , Mauro Carvalho Chehab , Stefan Achatz , Andrew Morton , Thomas Weber , Greg Kroah-Hartman , linux-doc@vger.kernel.org, Hans Verkuil , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 30 Jan 2011 13:38:30 +0100 Message-ID: <1296391110.2283.187.camel@neuromancer> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13) 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.6 (demeter1.kernel.org [140.211.167.41]); Sun, 30 Jan 2011 12:40:31 +0000 (UTC) diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c index 0fa23de..bbe294c 100644 --- a/drivers/hid/hid-roccat.c +++ b/drivers/hid/hid-roccat.c @@ -356,13 +356,16 @@ void roccat_disconnect(int minor) mutex_lock(&devices_lock); device = devices[minor]; - devices[minor] = NULL; mutex_unlock(&devices_lock); device->exist = 0; /* TODO exist maybe not needed */ device_destroy(device->dev->class, MKDEV(roccat_major, minor)); + mutex_lock(&devices_lock); + devices[minor] = NULL; + mutex_unlock(&devices_lock); + if (device->open) { hid_hw_close(device->hid); wake_up_interruptible(&device->wait);