From patchwork Mon Sep 5 16:45:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 1125052 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p85GjkNI024501 for ; Mon, 5 Sep 2011 16:45:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751632Ab1IEQpr (ORCPT ); Mon, 5 Sep 2011 12:45:47 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:40059 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751627Ab1IEQpq (ORCPT ); Mon, 5 Sep 2011 12:45:46 -0400 Received: by ewy4 with SMTP id 4so2295934ewy.19 for ; Mon, 05 Sep 2011 09:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=pksCRuEwC4WAEFNEeBwKrfEhB18uiQKXilGLzoPy+oE=; b=QGgg2BotzM3y0B6VHmsCbiLEHmLAQk5WXvxnf8jGgjMTdzFZXbufKokGtlRpPU3Eac gKXCinkARzUyNgKp9gA5fh03n+HJt6ZgOtupIAvzVKlnkp/smjBkgA+mO2rN9MRwKd/5 JutUEtry99edQRi3bKSAri/7SgI9Q0zFrWYy4= Received: by 10.14.17.25 with SMTP id i25mr895087eei.186.1315241145714; Mon, 05 Sep 2011 09:45:45 -0700 (PDT) Received: from localhost.localdomain (stgt-5f70b1cc.pool.mediaWays.net [95.112.177.204]) by mx.google.com with ESMTPS id e4sm10673822eec.10.2011.09.05.09.45.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Sep 2011 09:45:45 -0700 (PDT) From: David Herrmann To: linux-input@vger.kernel.org Cc: jkosina@suse.cz, David Herrmann Subject: [PATCH 2/2] HID: wacom: Unregister sysfs attributes on remove Date: Mon, 5 Sep 2011 18:45:29 +0200 Message-Id: <1315241129-3889-2-git-send-email-dh.herrmann@googlemail.com> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1315241129-3889-1-git-send-email-dh.herrmann@googlemail.com> References: <1315241129-3889-1-git-send-email-dh.herrmann@googlemail.com> 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 (demeter2.kernel.org [140.211.167.43]); Mon, 05 Sep 2011 16:45:48 +0000 (UTC) HID devices can be hotplugged so we should unregister all sysfs attributes when removing a driver. Otherwise, manually unloading the wacom-driver will not remove the sysfs attributes. Only when the device is disconnected, they are removed, eventually. Signed-off-by: David Herrmann --- drivers/hid/hid-wacom.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index f66a597..a597039 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c @@ -423,6 +423,7 @@ static void wacom_remove(struct hid_device *hdev) #ifdef CONFIG_HID_WACOM_POWER_SUPPLY struct wacom_data *wdata = hid_get_drvdata(hdev); #endif + device_remove_file(&hdev->dev, &dev_attr_speed); hid_hw_stop(hdev); #ifdef CONFIG_HID_WACOM_POWER_SUPPLY