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: 9754287 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 626D9602F0 for ; Tue, 30 May 2017 10:53:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53D06274B4 for ; Tue, 30 May 2017 10:53:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4635427FA5; Tue, 30 May 2017 10:53:38 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D95F6274B4 for ; Tue, 30 May 2017 10:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=ShxY8zFpjx6dlsTH2J04jdbNblq/wlW96L8xslZclT4=; b=T9k eGVG8bKI5eNhAhCbd+3gRiADP2CcI3KV8qJe6XZYkoSl+NgYZALinfuReIxV0EDsDuBRAzTvzyLb8 mWhguc+6ZVOfrbnRimcq+26a5et+SHucrYO09T4le3L6CS/kU7dLVVl76NcR2v9oXIlTu5aVeMkhB fpQ9d5dYsXgtuQAYBGF6rr4kWOhdhXs06/wXnTbxz4PEtzIO3Y4cAizZyDzSy9n1Mk90YYaaVYqtK cTPi2rBFALUnkhOuQdfFHnoMPVnib+dS7m8o+36cR8VQayHLf9fokIUD/erl/xInU18sScvaqHYAV 8DZ+a/C8g7wAb/BFjUiz6WKyJcSl2Cg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dFemN-0006QN-Az; Tue, 30 May 2017 10:53:35 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dFemK-0006Hv-E9 for linux-arm-kernel@lists.infradead.org; Tue, 30 May 2017 10:53:33 +0000 Received: by mail-pf0-x244.google.com with SMTP id n23so17071513pfb.3 for ; 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=g0UaJcT6hM/bdSRlV7nFlJSCLPufWeFi54dIEQMidKoXJayunR6jPUuZtBOVSkuLda SF6l+M1LMsIlZihWJ0S6dM3dwIbgDr7hjEzfwKqwElyqDLHhivXkFTtkI3AW8rEvuvqg J345qtdp+lZ5+npq6eQtJXIViUnUKWqdMvRkq3JRq2VdYPA44VvNNhSTMrjt8d3PbCPV 6GgA0M/Lp+OY6qF3pH1WSx/6e+NMpGFn0s6dL6zxYWqtY5VdIxBdSn8xmNgRQ+F5tLeU ZZt6Cvseyf64wEn25XjYlVxT7VSBObxQyj0IYTI7kyyE+B+P2yDK8r4gaUNWi2DKjQ9s tfdg== X-Gm-Message-State: AODbwcDsKAGidq7hS+ZC1dglkBkCLXf1QVPIaGyaeOKjYYpOWRTvh1C6 35D1So0UWcI5rg== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170530_035332_532532_C19C46E2 X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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; }