From patchwork Tue May 30 10:52:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9754283 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 A8D84602F0 for ; Tue, 30 May 2017 10:53:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C9F0274B4 for ; Tue, 30 May 2017 10:53:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9154527FA5; Tue, 30 May 2017 10:53:15 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 E47B827569 for ; Tue, 30 May 2017 10:53:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750902AbdE3KxM (ORCPT ); Tue, 30 May 2017 06:53:12 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33704 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbdE3KxM (ORCPT ); Tue, 30 May 2017 06:53:12 -0400 Received: by mail-pf0-f194.google.com with SMTP id f27so17101371pfe.0; Tue, 30 May 2017 03:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jcsqKVXkb1BIVPcX8nu+lRexGz6kC7xRdradVqg1wJc=; b=BpQySnGhkf4/9IvxAzirhZUVJYsQrbdAIEZKtCNSF0WCoL/4RnP84y86FwuU3nUgQY e94p0CHy22uUkqOKj/pSigWfWUkVe8Gb2DZXHos6WCYkhwtyGUDZ23NGEVAfobsdqxpK wZ9MHImnBBQXAE+6g/cUPtc1cAnWpviL3CEmc19FfvPFrmulre5gG4nOGjhqfSQemqw3 nyTsi/GeUr6z7hKKRO7lE0QawZONml5zM0bbz7MXwd5w0XveAIgWB+e4/D7fldwM1hTc eSloT9O6U/Myltwq6B6yWE63doIzwkUopMMULRQk//EkCLT6Pq0bepWhNzldWao1+jpK WcXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jcsqKVXkb1BIVPcX8nu+lRexGz6kC7xRdradVqg1wJc=; b=cr3YYhcsR4MIvcikEfw7HMBVe7ZGZZFVytahZASLywwFEv9NGWmwKkdfLR1SmPhB9w Cq+9v7YtHbv6AnpwUiNFxWqFuia8sBejExsrHJFRwFTZwjwN14a5WMDE7P/WUgdpJHNY PLcFvnWiwMUDUFbFbG3XBtjSar3qNyM5zhILLArgWevy8l3/IqGqzx/96yBjavxXUcE8 e0iq95B0goJVrHiXx33m5Z8vC9rNfcHrK1DceaYw6M+tM91Yk2u5movy5NZSddQM+yrr JxDvEbtQP3vHmHQquMX+5bqplKhcBIki4JPZICV7Ph4fcLiwyrU4n2nFu/KPL2dgKMu1 PJcQ== X-Gm-Message-State: AODbwcAhnqG/KZJLc6GYWd2+RzUhwm55SgwWMx+bZDyKzyILlmhexmwG o1dN/dfm05aXsw== X-Received: by 10.84.232.71 with SMTP id f7mr83425109pln.168.1496141591401; Tue, 30 May 2017 03:53:11 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id f1sm15287338pgc.8.2017.05.30.03.53.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 May 2017 03:53:10 -0700 (PDT) From: Arvind Yadav To: kgene@kernel.org, krzk@kernel.org, dmitry.torokhov@gmail.com, javier@osg.samsung.com Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: s3c2410_ts - Handle return value of clk_prepare_enable Date: Tue, 30 May 2017 16:22:57 +0530 Message-Id: <477d9b0992f4b16454ad1780eb4477433c075226.1496141406.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 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 clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- drivers/input/touchscreen/s3c2410_ts.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c index 41d58e8..3b3db8c 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c @@ -264,7 +264,11 @@ static int s3c2410ts_probe(struct platform_device *pdev) return -ENOENT; } - clk_prepare_enable(ts.clock); + ret = clk_prepare_enable(ts.clock); + if (ret) { + dev_err(dev, "Failed! to enabled clocks\n"); + goto err_clk_get; + } dev_dbg(dev, "got and enabled clocks\n"); ts.irq_tc = ret = platform_get_irq(pdev, 0); @@ -353,7 +357,9 @@ static int s3c2410ts_probe(struct platform_device *pdev) err_iomap: iounmap(ts.io); err_clk: + clk_disable_unprepare(ts.clock); del_timer_sync(&touch_timer); + err_clk_get: clk_put(ts.clock); return ret; }