From patchwork Mon Sep 17 02:29:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 1464821 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id ECD4C3FCFC for ; Mon, 17 Sep 2012 02:29:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752913Ab2IQC3K (ORCPT ); Sun, 16 Sep 2012 22:29:10 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:38116 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752805Ab2IQC3J (ORCPT ); Sun, 16 Sep 2012 22:29:09 -0400 Received: by obbuo13 with SMTP id uo13so8411399obb.19 for ; Sun, 16 Sep 2012 19:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version; bh=wFEKisr9NuFyDppDYPWMPMpiPhMf0cayk4I/ous6EYw=; b=r0dfGLJ8/zqTbc9S9xi5lesdLThnvBOoPodMfpZbBPDVw182DTdsn1W1Ek1c2/cUQd 32LTYmmupkEic1qLyBR9iTjeut9MA3701RNbY72iQ0R/kQ9gx/Fqi6GCCPBkJmv7tt6g lEtKfyrozz2Cm4n5AfAE3zMxkD4gzX7yvlNypHSwYZGc5IajQzVP3fa92ENjAkErK6xn 8VMYAA/idgmsMfYC93Bwp8kwb6LNL4m8ArBl5QPHRrl7byigpj+4xQY8C6v/EGPv4RWc 4+M5KAHvXXJ7XcTsJOL97TkMELrvcDsOyNMMOInVGib5hhA7mkEscgja4CfQAqLiRHcZ PN7w== Received: by 10.60.11.34 with SMTP id n2mr10244176oeb.18.1347848948575; Sun, 16 Sep 2012 19:29:08 -0700 (PDT) Received: from [114.39.107.183] (114-39-107-183.dynamic.hinet.net. [114.39.107.183]) by mx.google.com with ESMTPS id kc5sm9233320obb.21.2012.09.16.19.29.06 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 19:29:08 -0700 (PDT) Message-ID: <1347848940.20002.1.camel@phoenix> Subject: [PATCH] HID: wacom: Fix wacom_probe error handling From: Axel Lin To: Jiri Kosina Cc: Przemo Firszt , Ping Cheng , linux-input@vger.kernel.org Date: Mon, 17 Sep 2012 10:29:00 +0800 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org In the case of goto destroy_leds, we also need to call hid_hw_stop(hdev) and remove sysfs attribute files we created for speed and oleds. Signed-off-by: Axel Lin --- drivers/hid/hid-wacom.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index a0fafac..fae7fd7 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c @@ -902,10 +902,18 @@ OLED_INIT(7); err_ac: power_supply_unregister(&wdata->battery); err_battery: - device_remove_file(&hdev->dev, &dev_attr_speed); - hid_hw_stop(hdev); destroy_leds: wacom_destroy_leds(hdev); + device_remove_file(&hdev->dev, &dev_attr_oled0_img); + device_remove_file(&hdev->dev, &dev_attr_oled1_img); + device_remove_file(&hdev->dev, &dev_attr_oled2_img); + device_remove_file(&hdev->dev, &dev_attr_oled3_img); + device_remove_file(&hdev->dev, &dev_attr_oled4_img); + device_remove_file(&hdev->dev, &dev_attr_oled5_img); + device_remove_file(&hdev->dev, &dev_attr_oled6_img); + device_remove_file(&hdev->dev, &dev_attr_oled7_img); + device_remove_file(&hdev->dev, &dev_attr_speed); + hid_hw_stop(hdev); err_free: kfree(wdata); return ret;