From patchwork Fri May 26 06:37:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9749763 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 88D9860249 for ; Fri, 26 May 2017 06:39:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 747D9281C3 for ; Fri, 26 May 2017 06:39:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68159283BD; Fri, 26 May 2017 06:39:42 +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 2756A281C3 for ; Fri, 26 May 2017 06:39:42 +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=j15/+Vxf+YzWy/ipBexMu/jNeFRBMtlj70xXXx/5vUw=; b=MiB ioijIxi+oXMSnCjFxBtOEZj3qF+UO/3BtukYsJnNGezd8RG4nRT43pc+axZva+1i5i2iQfcqqasL+ VEw5MvkuuYysB9ZCNf5ixbqWKDQMfprcupntCe0DCM7vXXcDrNTlf0gDHD31y8dozy6I8X9xoiYNL W1fmNjVW7gDRWkUQDNRt4goyMwNcfbTybm3rHH/AB1ncsb/pRs3lq1q0mdtMgEY+grSGQyCnYc/fw qvR9IsBVbCWabm+rBWnumpdMlmuN1qEbpXjdwrGDejpnaArKMMYhsZrRWP7bBrGC+tSLvYoeo9/rh urYR9AdyXI1ipWvm3sG4+heYKmfSd1w==; 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 1dE8uT-0000Nk-6j; Fri, 26 May 2017 06:39:41 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dE8uP-0000K7-Ph for linux-arm-kernel@lists.infradead.org; Fri, 26 May 2017 06:39:39 +0000 Received: by mail-pf0-x243.google.com with SMTP id f27so672714pfe.0 for ; Thu, 25 May 2017 23:39:17 -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=oTvLTD4vkKupZqq+34dKjHFMpMaBQpya0RmjzLrp52c=; b=OmVLBbevbmVPSSxyUgQofP5QCCncixQp5u2z1Go1aMloT3fO7weBsZyZM2VGhvDTiI k0OSesM4njAWrMwjl4jozZktYEFdwQAsak0CB35BZ3ax+vvi3RsDjVBPsTzAnIY0yAaO VmMwjJbx0u2jmqcA86bzc0was8DLHPqwYhzShbAkIsJHDK1D+084WwiGhjPiKsGLyw4U RwLV4Y85qDOHdzXVCheKrtBMHj0Aig/Z+in8tsCJM+g6nU6Xf9jwCLVZReup6focVKnu ZLHtl43/+MS9DrojbEv17dJSMEhQEDgGqcsf1KDfHZQkkgpsGUUm/dl47Wac4FDTd+bY kaXA== 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=oTvLTD4vkKupZqq+34dKjHFMpMaBQpya0RmjzLrp52c=; b=PRSA3SVjqfjEJsQ1n9RW42oqjgBUG45DApZCfxn1ljsSXzuhnCyoNdQ5dl/A1gJizF +mg6g/EF5MqlvNcue1Ir/Yc95POzuQjS37RQznuvLwtbSs4ZRpE6FbCGAs6oh+dh9/oS FZqTSPDWH0WoVt32vfYijoHY6S2viA0zy5RK4L6i/B6mzk4nnnXcwya6E65TNJtViOlG nOX7LS/zKncSXvTZw4iQRnfxKMHOfQbk7QvV1JJ3UL0pp2ulPZa7viJ9G+coUhmfzlnd BIFBrpI5LGfWSPGGuvOUmBZ5ZA5FR2Y2ZDUYZ6LkVIq2r+Cx/qdJPItoHQMnVGKHsi+m Ldpg== X-Gm-Message-State: AODbwcDD6ebSlOsIb2wJUC19KirbSuDWs+1E3Z/Y3lNp77jWm9mAQYrg /avHxzJlzY7vlQ== X-Received: by 10.99.134.194 with SMTP id x185mr525436pgd.174.1495780756990; Thu, 25 May 2017 23:39:16 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id m5sm24540102pgd.28.2017.05.25.23.39.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 May 2017 23:39:15 -0700 (PDT) From: Arvind Yadav To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, soren.brinkmann@xilinx.com Subject: [PATCH] iio: adc: xilinx: Handle return value of clk_prepare_enable Date: Fri, 26 May 2017 12:07:41 +0530 Message-Id: <29dda0d20f714ce828e294f99b7f400e89f5b35a.1495780467.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-20170525_233937_891920_B49D2834 X-CRM114-Status: GOOD ( 10.18 ) 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-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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/iio/adc/xilinx-xadc-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 56cf590..4a60497 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1204,7 +1204,10 @@ static int xadc_probe(struct platform_device *pdev) ret = PTR_ERR(xadc->clk); goto err_free_samplerate_trigger; } - clk_prepare_enable(xadc->clk); + + ret = clk_prepare_enable(xadc->clk); + if (ret) + goto err_free_samplerate_trigger; ret = xadc->ops->setup(pdev, indio_dev, irq); if (ret)