From patchwork Mon Sep 19 01:49:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9338421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B04BA6077F for ; Mon, 19 Sep 2016 01:49:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A10B328EA7 for ; Mon, 19 Sep 2016 01:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94DFA28EA9; Mon, 19 Sep 2016 01:49:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3EB828EA7 for ; Mon, 19 Sep 2016 01:49:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936368AbcISBt2 (ORCPT ); Sun, 18 Sep 2016 21:49:28 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35036 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936003AbcISBt1 (ORCPT ); Sun, 18 Sep 2016 21:49:27 -0400 Received: by mail-pf0-f194.google.com with SMTP id 6so3504153pfl.2 for ; Sun, 18 Sep 2016 18:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=1zAe/XuHVKh8Scvl2zp9DJ/PNnFcHegNdgxNnEyTblA=; b=YbIPp1fsiC2UCCzLwAv75YtYYE9XvmC688vjRmwtVBwsHAboRSAuFpWIa/Rxre+Na8 JrsR83Dayxw8L4Non6TfbwucoXY4B+Ltnum+pPxg/iEok+WMEeh6c4RMJRjTiXPQl9kq O4EsVytb0NzLCXDrzfjCaJOPkvqjU8OGfvrNsBuKLCbmWQ3OkKQZSG4Vc3fotOwcN1mz 3BmgnJUsTicUyQqAiYu224/5877EWIbqQ15cU8SE5u+NygJVctZpCGcmfYRp5qEb8YKN zP0tmrULF20Q4sdqLa/8pX5XxCZ4/TzBx/fi0m+dMJfnhYz3Xdhd08envLZ4X2ZkVY+g WCTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1zAe/XuHVKh8Scvl2zp9DJ/PNnFcHegNdgxNnEyTblA=; b=cE8oQy1GyFxGGYxfaYGDuLCRe9v9nKqiao/WEI8d9okxN1kfdDZ34+JostG71Rkkyt ElNSpFGtLF83o2lP8rItmj6Vlz9mLwa98vbOuEKMPtTiT2x3O72zcR241YILHeVniph6 Nv+JM1RJYuSsgEYQXLwdQLM1Pzw9UBLKJhuJ5Emic5rZi+MM7OTQsf5YkMOgoCZTcExZ 8OFTu0LGBYOfB5A2tYZEQI2thqzNeV21QZgcnoQ1CX4uKi161K19uIMsiKz15dSj9XX/ Xp//x1B01k4onBQsnKpk23oUeNKoEALHVvWIQeOwG0dqMp38tXWgKFQm+m7Tx158lTjt ZPZA== X-Gm-Message-State: AE9vXwORgC9KOxtHdKsowk//Cv20CBIW7omGAbH6UYOt1l9GeQjRqau6uPlaunNysFhbpA== X-Received: by 10.98.70.132 with SMTP id o4mr25363265pfi.132.1474249766878; Sun, 18 Sep 2016 18:49:26 -0700 (PDT) Received: from localhost.localdomain (118-171-143-8.dynamic.hinet.net. [118.171.143.8]) by smtp.gmail.com with ESMTPSA id p7sm18945387paa.3.2016.09.18.18.49.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Sep 2016 18:49:26 -0700 (PDT) From: Axel Lin To: Dmitry Torokhov Cc: Frank Li , Robin Gong , Shawn Guo , linux-input@vger.kernel.org, Axel Lin Subject: [PATCH] Input: snvs_pwrkey - drop input_free_device call if input_register_device fails Date: Mon, 19 Sep 2016 09:49:16 +0800 Message-Id: <1474249756-30843-1-git-send-email-axel.lin@ingics.com> X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current code uses devm_input_allocate_device() so don't explicitly call input_free_device if input_register_device fails. Signed-off-by: Axel Lin --- drivers/input/keyboard/snvs_pwrkey.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c index 24a9f59..7544888 100644 --- a/drivers/input/keyboard/snvs_pwrkey.c +++ b/drivers/input/keyboard/snvs_pwrkey.c @@ -168,7 +168,6 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) error = input_register_device(input); if (error < 0) { dev_err(&pdev->dev, "failed to register input device\n"); - input_free_device(input); return error; }