From patchwork Thu Jul 28 09:07:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 1015072 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 p6S93FuH023520 for ; Thu, 28 Jul 2011 09:07:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753248Ab1G1JHL (ORCPT ); Thu, 28 Jul 2011 05:07:11 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:39987 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754161Ab1G1JHK (ORCPT ); Thu, 28 Jul 2011 05:07:10 -0400 Received: by pzk37 with SMTP id 37so4218611pzk.1 for ; Thu, 28 Jul 2011 02:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=iCuuaVX+awbXkR/mhmRzZTPp0/h04JBIjDHhkdmQQaQ=; b=SLo1yG+9dS04s8uuTAGk7xCA3wD0UHk6I79H+My1TG/e2fSfgsHf3CRX/eRBL8G8cO kKuUftBwqAQ8cpFa/IsXViHnxJmfRml7E60DIBMtSAiG3roEfAEhsH163BEsBoxMVwCz Kaiu5gIG0hIpJoGFJh38u6NGr/bvUonJipRBY= Received: by 10.68.25.6 with SMTP id y6mr1356450pbf.473.1311844029490; Thu, 28 Jul 2011 02:07:09 -0700 (PDT) Received: from [192.168.0.115] (218-160-84-213.dynamic.hinet.net [218.160.84.213]) by mx.google.com with ESMTPS id v2sm579076pbi.67.2011.07.28.02.07.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jul 2011 02:07:08 -0700 (PDT) Subject: [PATCH] Input: lm8323: add missing device_remove_file for dev_attr_time From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Felipe Balbi , Dmitry Torokhov , linux-input@vger.kernel.org Date: Thu, 28 Jul 2011 17:07:01 +0800 Message-ID: <1311844021.31725.3.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 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]); Thu, 28 Jul 2011 09:07:12 +0000 (UTC) Add missing device_remove_file() for dev_attr_time in lm8323_remove(). Also calling device_remove_file() in lm8323_probe() error path to remove sysfs attribute file. Signed-off-by: Axel Lin --- drivers/input/keyboard/lm8323.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index ab0acaf..756348a 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c @@ -754,8 +754,11 @@ fail3: device_remove_file(&client->dev, &dev_attr_disable_kp); fail2: while (--pwm >= 0) - if (lm->pwm[pwm].enabled) + if (lm->pwm[pwm].enabled) { + device_remove_file(lm->pwm[pwm].cdev.dev, + &dev_attr_time); led_classdev_unregister(&lm->pwm[pwm].cdev); + } fail1: input_free_device(idev); kfree(lm); @@ -775,8 +778,10 @@ static int __devexit lm8323_remove(struct i2c_client *client) device_remove_file(&lm->client->dev, &dev_attr_disable_kp); for (i = 0; i < 3; i++) - if (lm->pwm[i].enabled) + if (lm->pwm[i].enabled) { + device_remove_file(lm->pwm[i].cdev.dev, &dev_attr_time); led_classdev_unregister(&lm->pwm[i].cdev); + } kfree(lm);