From patchwork Mon Jul 23 15:02:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10540479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DF83157A for ; Mon, 23 Jul 2018 15:03:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFCBD204FB for ; Mon, 23 Jul 2018 15:03:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E365827F97; Mon, 23 Jul 2018 15:03:22 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 7F47B204FB for ; Mon, 23 Jul 2018 15:03:22 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=CppuC00g1l4jayz1xOHmwdFQdoCACedqAWaGJlXYdK0=; b=IcJPdTOQEBXODA y6C+pfY/Z7hWMW/FNHXiY3Q9pqxOF6RqyN7LXnNpSQnhMNVX5f6Psvuu/s4UfVDKc/O7lLV63Kf2t N19Bgdaahfqj12/k80oTC8pgeTQNHrgXGG0CwPqn7FLAnDmnw1UsX3u2gWxvbLdRVk6pJbVJnEk+W PCUg8qaHynKDNBuVqDnzC5waZE7UlZZffCGWkgxWzw/ToUXaR9onuT29vgG0SloogDtJyWwG0PyxC lYvAPxl9i0Skzptbb7grvXoC/ZeYXn6sgxddM+z9kkwrh8r/J0c4ecrGCMt5UYGCbho3HOxK81tRB Bxd+Exw8iXTG4Qe64bRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMl-0007ys-R1; Mon, 23 Jul 2018 15:03:15 +0000 Received: from mail-cys01nam02on060a.outbound.protection.outlook.com ([2a01:111:f400:fe45::60a] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMF-0007MK-Sj for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 15:02:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g19W8PQ68DIBTNKR/Ck3+nnZEpSZ+O0mEgpiFVptDO0=; b=nd9fNPuw7+dnzEZvwKh137Qw6ityNLj8oRggcHS5EF1d9Z4AuNadvLuyb6Lhww5tuOQRWMIsqmFYp2T6oDp59tmUdqb6uLI8rZDUpIWcA8KobYwqWGY2m0NXozys1pOiqkRvanXXqVO3jYczSJ8z5xM/kOxr3F/YNn2tF0ZCPq8= Received: from MWHPR0201CA0103.namprd02.prod.outlook.com (2603:10b6:301:75::44) by SN1PR02MB1631.namprd02.prod.outlook.com (2a01:111:e400:519f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Mon, 23 Jul 2018 15:02:28 +0000 Received: from BL2NAM02FT042.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by MWHPR0201CA0103.outlook.office365.com (2603:10b6:301:75::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.20 via Frontend Transport; Mon, 23 Jul 2018 15:02:27 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT042.mail.protection.outlook.com (10.152.76.193) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.995.12 via Frontend Transport; Mon, 23 Jul 2018 15:02:26 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLy-0001B9-9e; Mon, 23 Jul 2018 08:02:26 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fhcLt-0008VL-67; Mon, 23 Jul 2018 08:02:21 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w6NF2IEc013273; Mon, 23 Jul 2018 08:02:18 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLq-0008UV-CO; Mon, 23 Jul 2018 08:02:18 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 82E01121473; Mon, 23 Jul 2018 20:32:17 +0530 (IST) From: Manish Narani To: , , , , , , Subject: [PATCH v2 1/4] iio: adc: xilinx: Check for return values in clk related functions Date: Mon, 23 Jul 2018 20:32:00 +0530 Message-ID: <1532358123-23485-2-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> References: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(106466001)(2616005)(486006)(16586007)(476003)(42186006)(4326008)(103686004)(11346002)(106002)(316002)(5660300001)(48376002)(14444005)(63266004)(81156014)(8936002)(44832011)(51416003)(81166006)(6266002)(54906003)(52956003)(36756003)(2906002)(186003)(356003)(90966002)(305945005)(47776003)(426003)(478600001)(2201001)(36386004)(446003)(50226002)(76176011)(26005)(72206003)(50466002)(110136005)(8676002)(126002)(6666003)(336012)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1631; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT042; 1:nkoAttzkloz9ixfib3sypRo0Y2GlDHhMtxAZCw0pp/e772ukG9kHiMR/DOjp94jULki/ibQyu+7LsO3UHHoBPakjFbJ1fnn5m6kyYU6nlIXrBTN/cijvRAMj7EfiIods MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f803ba1-93c3-4ea3-931d-08d5f0ad4dfd X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:SN1PR02MB1631; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1631; 3:DztnGpKVakLq2x59SRKtFlZVK6mf+SizZ0rCZQgSBGe6fMdOp/5inCtLqdpE8L3ATroGV5PtKvr3rWWFjkWfqWfEcArhOFHOHPyITzHVzfk2otSfY7UaY7Ex6k5gSS6/A9+VJpCK4dIEM6nvyTQ3aUPBIYcgbbeMtXLWB275PcMjEEeO17NFUDDFh0K6hnXGLEyFX8TMDuDMRgcO8OrBCpZnElhGIfPYLRiDsYC+OcT9S45ijlm1LJQwFF/CQCHvdQP5kxDn+jaa3/B/19egwk9aI54RnPDSYkTPn9rcPg9pbj2JRmaiZ/8A8fR6iuDVNVDyYeF2vTmn+FfPkMMa2XuBbDylvO7tug7KR/TTZ78=; 25:y3BulFPr1Wj2UiUzIcQErZoxZrBS2JCAA41F739BiH6AkWEbhrVOlcclEtHChNLo7GCNNiZTWAwyPflNsrdqeIZ2fgTQYbgxR7y8h6pc0/oCHoI5144DHOiYLtbh35at7shWS9L6PKWue6RWiexEaaa+MI6l1OzNKTV1oJDtCA1D32++Yu0vir0ZmMVJXsR1/Hsh2qdv4yQCJPcKSFANQkJIsJc6hpZ2g8HfWoYLsK5vH9VMW+ajHT9NCmctGVErSUK9u+r2MVKBs8aZW57/CU5Gu7x/nThEs32YnUDmNTVPowLvCjj872D/zMASvIDKDoIrEegK80Jwf3G2LtqJgw== X-MS-TrafficTypeDiagnostic: SN1PR02MB1631: X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1631; 31:hVADJLpYA+euj5IMpWkY1KfaYv2pwO1mAwJSOU/CtGTmBeWHS2LqVD0epfQJ8fO6p5KE+ZKdRyND8AgDqVbrLOwoQFTOzfLLhFBKWmeZ+PTUbdzWPxlO6qK73TkPxCBLMEMH/z864N5q+A2C5cRtduGwRfUi4ke/Y9BF5sQoscb4e1jfGASI0kUf3l1AnNDSoLZofgz9mZSTpnDKNXwpAszh22gq22pWNlkWlX4K60c=; 20:D4grhq0wQTcJWz3QQxopKWR2Rg9HVlmmyaREns0lGpRBA/vHIiR4Igw2k1HcEWOrSd+0OktXyq8hnJGDgv46X77Ma7FwB6NL73lnWE207q/ieShATTQUalYlQInJHviCWKtYWRDbjSghi4qRQuqRQpD7+MtssTzfzulS7OeUBTQr5Q8YNr+kVlTy2cH4YDgcJsXKmDR8AtLqiS4ZxbadeGbUNIgOS1yuGg8ApT9ueF5C4WN92D71+Ujr8SOBp6xS+Md/EE+EDZ0J4WKIpxwQ8D/6Z1jabzFb3sBU1TeE7OaS+TIt6ldJ2QfeVT78957opTi7Y0FreesJleJlDtoPh4gIAqBu7oLhoLDA7ealVaz+myTUbS6VM3yN3KrXqrrMteutBDh05RUo+2NZPNWmOFGTxJ6DlfndzLcb3BFi8MNkaKEaIDG+i4mm6I/B450OciwwWRjdt8hupdys9zZEkLJkOTkUw3H4ajY9c9bo0VyfSg2A9HIq9PBkJ/5uMnNX X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:SN1PR02MB1631; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1631; X-Microsoft-Exchange-Diagnostics: 1; S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0OdNtNSiPkebf6jUZYI+QSIYeePQ4ZGaNYPHxtgDsn+g+Ld6YpCh6JCFip1qDeCePiOy9wCx+VjigqbbNRBhVHcaRfahDyaJsgOSujaERArkG+sVeptcn8459MtfBujrmRhwVH27PO5bJX4InwJ7Qvyqe+Z3BzDWXAa7XAUzd0YGlFE4I0MqXKvWlZuBbm9IoAHvhn5gf13D/2HRkIQb7Vs37a9jBdNaWSktFyMFj/ccmcCqpoY71GqRUJAZn0M1Hk1NQxptMx/kP4kjq7HTCm8JALfJC9uor8ymLF90pUdQxy4G7o2Oq23uNBK5iqsCUJrvNQCMQzm5jziZs+9rL1zTAfmmQZtvAsgYO6vTpI3lx8G9hmnkg==; 5:auPwziewCN55Oc0v6MVPOl9YoHtHVpxYSzteMyXUvDf+bDLASb37eUGsYWWFwi0wzMcpQXmgfSqv34vju52ibWfvMfLkNiRe2GiA1PhNfcwbpw/P8YkcDosQ1Kcm3KQX5+nslAoEmJ7awCJBIVhZjv+6civI0Vz1NrK3cyyZ8iU=; 7:qx37gLIpS/Q8MtWCImZGBVfHbYx7ZybNUubqSLn0R26Lzn6URGsLckdPgZjK7wm0sauwMuaWkZulNZTiWjKKDjsRkDmacc7W9lWIoDjRKHkPKllR9iExq9pisZXWVPXluwsfxcftoFZX6Mwbt0/0j7+P4jtake3Hd4bU4JFPW1hliUF4i+nCmcY5bgrilUzLTFVBSX+Vsh6KfwnO0/h8StThq7kuwYVUxZNM+vyDCa2M4u3NIfnyu5gIC8IK9hef SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 15:02:26.9390 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f803ba1-93c3-4ea3-931d-08d5f0ad4dfd X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1631 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_080244_143277_A501883D X-CRM114-Status: GOOD ( 10.69 ) 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-arm-kernel@lists.infradead.org, sgoud@xilinx.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, anirudh@xilinx.com 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 This patch adds check for return values from clock related functions. This was reported by static code analysis tool. Signed-off-by: Manish Narani --- drivers/iio/adc/xilinx-xadc-core.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 0127e85..23395fc 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -340,6 +340,8 @@ static int xadc_zynq_setup(struct platform_device *pdev, xadc->zynq_intmask = ~0; pcap_rate = clk_get_rate(xadc->clk); + if (!pcap_rate) + return -EINVAL; if (tck_rate > pcap_rate / 2) { div = 2; @@ -887,6 +889,9 @@ static int xadc_write_raw(struct iio_dev *indio_dev, unsigned long clk_rate = xadc_get_dclk_rate(xadc); unsigned int div; + if (!clk_rate) + return -EINVAL; + if (info != IIO_CHAN_INFO_SAMP_FREQ) return -EINVAL; @@ -1237,8 +1242,10 @@ static int xadc_probe(struct platform_device *pdev) goto err_free_irq; /* Disable all alarms */ - xadc_update_adc_reg(xadc, XADC_REG_CONF1, XADC_CONF1_ALARM_MASK, - XADC_CONF1_ALARM_MASK); + ret = xadc_update_adc_reg(xadc, XADC_REG_CONF1, XADC_CONF1_ALARM_MASK, + XADC_CONF1_ALARM_MASK); + if (ret) + goto err_free_irq; /* Set thresholds to min/max */ for (i = 0; i < 16; i++) { From patchwork Mon Jul 23 15:02:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10540467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A187114BC for ; Mon, 23 Jul 2018 15:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D3BF204FB for ; Mon, 23 Jul 2018 15:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D46428498; Mon, 23 Jul 2018 15:02:48 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 E5F0D204FB for ; Mon, 23 Jul 2018 15:02:47 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=VvPxgCuJIjmWqtDxCJCB7MlpAaHI+ZosLcvjIjQzXVg=; b=PZuF6HZ61gkw0u vnl5RLTaLl+BE89IyAH/kP4Ud/sYSFaHpMeTjc2Nugi/YHwvCAoNlfsc28RivYvybe93QyT/OVmsq 79fM0+H0U+AtFQqK8VWhamsYvyyWWc4gQWYCs7rtLK6iMvLLKfJ5g9JbldyQQJiD4b2JlK1O3iq9a C5PjYQxVFaxkE9yp02IRmNwOV9RpReALY7VsqfzM5OoiQqreEfWMfo4LDAzfZyjfmtBsLSrBi1xWs fCTTyCNHOZQgn6gvA8Pvei6dZhEOoKeVzscLbh8OX753hP0hwHoY0I6HgIozHGu5GFrlsHy4E4HgN fqRl/Ve07od4BN6sylbQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMG-0007PV-MO; Mon, 23 Jul 2018 15:02:44 +0000 Received: from mail-sn1nam02on0081.outbound.protection.outlook.com ([104.47.36.81] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMD-0007MI-Im for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 15:02:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eBX4l3cRuACSUgIcuhst4CNhOnk1d7g16GIMo3BLE0k=; b=k9h2T9N/RuIhrIZhdLY3B+F9JXoe3r6Fy1fFpswcSUy4V2lQWFzgS/G08ElXl2+zX+66QBtZM90C7MZLaCjszeGzMxKKOIGBwp2aNH3To8ez5LIf05jjDU0ZKXbWmV6+NDfkSEGwtDbwNbv+ttq8InN6AG1b+Be4F3F/Gpc3M0w= Received: from MWHPR0201CA0021.namprd02.prod.outlook.com (2603:10b6:301:74::34) by BY2PR02MB090.namprd02.prod.outlook.com (2a01:111:e400:2c1c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.973.21; Mon, 23 Jul 2018 15:02:27 +0000 Received: from CY1NAM02FT027.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by MWHPR0201CA0021.outlook.office365.com (2603:10b6:301:74::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Mon, 23 Jul 2018 15:02:27 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT027.mail.protection.outlook.com (10.152.75.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.995.12 via Frontend Transport; Mon, 23 Jul 2018 15:02:26 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:43473 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLy-0008L7-2t; Mon, 23 Jul 2018 08:02:26 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fhcLs-0008VL-WB; Mon, 23 Jul 2018 08:02:21 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w6NF2JEm013277; Mon, 23 Jul 2018 08:02:19 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLr-0008Uv-ED; Mon, 23 Jul 2018 08:02:19 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 8D757121479; Mon, 23 Jul 2018 20:32:18 +0530 (IST) From: Manish Narani To: , , , , , , Subject: [PATCH v2 2/4] iio: adc: xilinx: limit pcap clock frequency value Date: Mon, 23 Jul 2018 20:32:01 +0530 Message-ID: <1532358123-23485-3-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> References: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(136003)(346002)(376002)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(106002)(47776003)(16586007)(76176011)(26005)(42186006)(316002)(110136005)(54906003)(186003)(48376002)(50466002)(336012)(426003)(6666003)(11346002)(446003)(2201001)(51416003)(50226002)(2906002)(90966002)(106466001)(52956003)(476003)(126002)(486006)(2616005)(44832011)(14444005)(5660300001)(356003)(103686004)(81166006)(8936002)(305945005)(8676002)(36386004)(81156014)(63266004)(478600001)(72206003)(6266002)(4326008)(36756003)(107986001)(5001870100001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB090; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT027; 1:wYH8gwgvEGaCadvvkkZTuCIRPkXSlpE/eFVDtH1hSjVtFdC21r7rkVWpjyfpyDUe7TYUueKBjCJuQIuQU0PAlRF8zR9m/cB2aUv6vGU9xXoIbIASC6zMXLEkaXFx3CFq MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: feaf4de1-1b31-4921-c32f-08d5f0ad4e10 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:BY2PR02MB090; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB090; 3:9I2Scsa25W3gyADfLmeV4Fbk3SHtYVmlXfR/emR2THa+ykaCzrzzw76Q05SzKs7kr+6J2ND3zEMmzBIXwuMsVxSU8hJ/xM4LXPd8pgmCcDYwZ28QAwu0eQYnr20KY7RYJ6bsCmBFpJ4k351bFBrJWAmaoXv+j39nMDJhcMUuEoe/8xz38wWpsB/PqiSEF//KGrBEJF6kXKYihAHaGLOS9WQfYkjNmD11FlWlSY+Ecq0b+Vtz+Q1M2W/CbRVOa4X/1agal0R/fdzZCci0BuuJlvUCb+xXvtwxvnQzCDLAt62YFuuv8zT7xGpo3EJptTwu/XOlMtXfTdle7NdI/GSBzRAEnjQHP9rIAFhaNP1Aokc=; 25:q49QTCAcUwUMlUoVZyXK/wOaSS+6Am1H2rr4XlHd/a6lQmQ3SzMbBDrP3U3/sk//YOy14n9efXskb/nxU/FzJN8MOah9jQNFJxP43+Ww5g4U7AfaSj6FMW9Sdcdn/d0tZE4sMpiswuupU/8Xn9rPqVZe0Ku1PcWtTWXCupoyY5mI9HI72wglagYKBkX/5QKsLmtWWRMObtr+oU9ltriKgY9Z6moiHAJYfm3zs1mBCRi/HciFccroorLG7W2P7Qaslo85b3z0oiycjKAhKPFs19gPfrEg15M6OvlA4gDuRFHUsRPO+uGhtYTgPd106EOoO9KO0jK9mGK1w6/bxj2rzg== X-MS-TrafficTypeDiagnostic: BY2PR02MB090: X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB090; 31:NkAL10hAPeU5npOrTYpgLqGITuKZzkFqWbAOvfVdQBFlptdMgT7XdbeMfRRAYqzGv9fRVAMW4cT66OlYurpTdhSDep5JJAI9Z9LREPJV6/wRXB7mTiQQvphLtF2inf5kH9/+wQLrwacBp+68sLZlQU6DZh8pdhtPs5gUgcq/OHxTVXY+1ccFOFAUzIrUG9fXZ9yD+m0ZApjPJ0b/R1BTvtheD74lew/nS33cXt7n668=; 20:VexEaJ3r1ICAE5ygljnZXeNKs1XBghceWPiViDiVUi5HIGvsEQhzb2Ac5tg17Kya776YFCBbj0ffbbtUuqAISfmI/OHSD/6971k4DaFl4YgBDCR/DyjTq8boRQBNpFAGc/BStieZC+vQfJWzAC29urphDmY0d6FrsXp4c20W7zwLWaPrQrGDUPyI7u9XtrXzzcQR0EiSAoAXuTy5l7Yw+W9z/9TUsuHUKb/GFcR8EjmX4LmJD3Zwy5o/L00NhluLKvY6z2vm4zx3Y1Qaj0uICAkEyw+HIOmpcYWsr7d1VeYfmQZK4LlZ63qx96r+Wy+bI2Ix1SGQ6082ig/h96hJSAqrGKm81TSP1D6AV8pTp04e0e6LF0eQBwfGvvgndMIay7IHYe5AnYatGUd9K6E2SRTdsaHiewh6LpiB01nekktCSTPcRB2XICcsyH5xEWzT5NZZYkdL6g9f43fUmr9CNxwMlvKeM0xKKc0+7qauqlWcdOZmQgxQdOcUSVQfOs0f X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(3002001)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BY2PR02MB090; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB090; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB090; 4:Au9es/h9X9QF3wuPXFb1SmtKNyQlvt5voZ2hxy59lfpKQ+YYR8gGRoNIJv0bQ9TluTv+u66FaOdHCK4tFX8Fq84xHAmsV3tpVBa68P7IWynVUHRMvgnTMHiuMCdwlRpKKj97uDQs6asjFe+76N4iO+SbZE9VjJGz/YeIVJUfXQFuvfqP72un21lqnlmjhiavwnchVZrxwNedDYBcuA76dog/Xs6iLHi1IOHjax/+qD9uRtN/Io3GF9xC8HGXQLoffuOBRVSuSLJ3LyDVY9jCDHq0JzaS9f9xdt3Ph+JPT5FFcxnf258cbymKvZPIhvW9 X-Forefront-PRVS: 0742443479 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB090; 23:nKA8U+ALs16Clr8ClYUNE4NwUFqtPTE0wrVUn0zyEx?= GWxaT7Gf55afDttkWpcjRR9GYSN9PisyeqKlwxeyNvvl6CCcDX6hPJmpm/wunVrAk6+vhuJcjHRwajE/5UsZilSntQ+iKP3EnQLm5o/ym1rWwryakAW3UcAVAy5VpiiIhxA1UW82TSWctKdSzLdRYL/T5fSV6Ht6y5/CyxjSbLfg8GhnLLQHYqvk1dMyWqjhqCz7nWEjiAax6kKwscVr2dORJcLC246T1amWEWF0prAqVzduX5tcVdR5CskgewpNjXN+v84OpRyksAPzsmwPHkBvIJDKErhz2TonwNdgWuLjClWtm+85cKhJTI66NwLc1kb1cykq0GrfKAjp44REuN2Zbt7OyEblKNAuMcgClkaGCpyNSnsmswyVUoz24Fcc/FAv9NATYJcDM9Qps7ArhCiAB6nPouYT2Y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qoai1uJjydaOktnyEZPYAZzBSGuRGXqFnRWkwIHA7tNydgYKIava3yzsY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 15:02:26.5491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: feaf4de1-1b31-4921-c32f-08d5f0ad4e10 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB090 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_080241_658587_ADC919A4 X-CRM114-Status: GOOD ( 11.86 ) 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-arm-kernel@lists.infradead.org, sgoud@xilinx.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, anirudh@xilinx.com 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 This patch limits the xadc pcap clock frequency value to be less than 200MHz. This fixes the issue when zynq is booted at higher frequency values, pcap crosses the maximum limit of 200MHz(Fmax) as it is derived from IOPLL. If this limit is crossed it is required to alter the WEDGE and REDGE bits of XADC_CFG register to make timings better in the interface. So to avoid alteration of these bits every time, the pcap value should not cross the Fmax limit. Signed-off-by: Manish Narani --- drivers/iio/adc/xilinx-xadc-core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 23395fc..0dd306d 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -322,6 +322,7 @@ static irqreturn_t xadc_zynq_interrupt_handler(int irq, void *devid) #define XADC_ZYNQ_TCK_RATE_MAX 50000000 #define XADC_ZYNQ_IGAP_DEFAULT 20 +#define XADC_ZYNQ_PCAP_RATE_MAX 200000000 static int xadc_zynq_setup(struct platform_device *pdev, struct iio_dev *indio_dev, int irq) @@ -332,6 +333,7 @@ static int xadc_zynq_setup(struct platform_device *pdev, unsigned int div; unsigned int igap; unsigned int tck_rate; + int ret; /* TODO: Figure out how to make igap and tck_rate configurable */ igap = XADC_ZYNQ_IGAP_DEFAULT; @@ -343,6 +345,13 @@ static int xadc_zynq_setup(struct platform_device *pdev, if (!pcap_rate) return -EINVAL; + if (pcap_rate > XADC_ZYNQ_PCAP_RATE_MAX) { + ret = clk_set_rate(xadc->clk, + (unsigned long)XADC_ZYNQ_PCAP_RATE_MAX); + if (ret) + return ret; + } + if (tck_rate > pcap_rate / 2) { div = 2; } else { @@ -368,6 +377,12 @@ static int xadc_zynq_setup(struct platform_device *pdev, XADC_ZYNQ_CFG_REDGE | XADC_ZYNQ_CFG_WEDGE | tck_div | XADC_ZYNQ_CFG_IGAP(igap)); + if (pcap_rate > XADC_ZYNQ_PCAP_RATE_MAX) { + ret = clk_set_rate(xadc->clk, pcap_rate); + if (ret) + return ret; + } + return 0; } From patchwork Mon Jul 23 15:02:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10540481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56ECA14BC for ; Mon, 23 Jul 2018 15:03:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 441D620243 for ; Mon, 23 Jul 2018 15:03:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36AFF26490; Mon, 23 Jul 2018 15:03:37 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 CB31920243 for ; Mon, 23 Jul 2018 15:03:36 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=igOkGTQrlRaBiYgzxJnzYPiKEbV2e9r2Nb4vwstBTJM=; b=r8YdNzl7S2T3y/ CobxSH/1RodxmzrHrdRf1Kd2KIBjluW5y5Y3YeD4p36weF/muETU5+e9udL6AptEYNSHzZ1+vb/Mu RCWFDQRtyVgkc1dHKN+RWeTO+E+aRBmmO/eBt7Vvt9bErUXWphzOh6RsnMyhJVILVL1aFd1lAoYW5 pGE0ShzW8nYvm2PEGQmFO10gyhGVRvRNjklwoNlAC7+brK+L8qDDUSIyzFRvy1bCtZmRpISfeZIat PrISqUKUWCcCGg+2Ttmfm/bu1l7sRwM8vr4z6alSD4QnDTUCjOZz3xJyVSO4BKQQ6wQM3iaSv98tO brOxMH8FqP8AJy7OVL7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcN2-0008Hn-Om; Mon, 23 Jul 2018 15:03:32 +0000 Received: from mail-co1nam03on0053.outbound.protection.outlook.com ([104.47.40.53] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMQ-0007P1-Ni for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 15:02:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tVS7GIumw9Lm6ZF2J9HmrDyoMZhD0vLIZvTS279xsZM=; b=hsI3G7uXDmv7iD1IK8WKK29EOt6m4ClUAmrW+MXP8+ueTq1g3nhIsW32KZk6PICfSki38ufWwFKNpsQPr7VTcYpdvQSiOyllnwu0GBghSSBBvpWzkRePMqQNduZnztoNa3K734eftfWTeAWUYv7QolPIi6GY6Nf5QSs2hLdj99w= Received: from MWHPR0201CA0002.namprd02.prod.outlook.com (2603:10b6:301:74::15) by CO1PR02MB094.namprd02.prod.outlook.com (2a01:111:e400:101a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.973.21; Mon, 23 Jul 2018 15:02:38 +0000 Received: from SN1NAM02FT034.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::208) by MWHPR0201CA0002.outlook.office365.com (2603:10b6:301:74::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Mon, 23 Jul 2018 15:02:37 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT034.mail.protection.outlook.com (10.152.72.141) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.995.12 via Frontend Transport; Mon, 23 Jul 2018 15:02:37 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcM8-0001BX-Dx; Mon, 23 Jul 2018 08:02:36 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fhcM3-00006E-AZ; Mon, 23 Jul 2018 08:02:31 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w6NF2KFj002955; Mon, 23 Jul 2018 08:02:20 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLs-0008V8-AR; Mon, 23 Jul 2018 08:02:20 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 65327121473; Mon, 23 Jul 2018 20:32:19 +0530 (IST) From: Manish Narani To: , , , , , , Subject: [PATCH v2 3/4] iio: adc: xilinx: Remove platform_get_irq from xadc_remove function Date: Mon, 23 Jul 2018 20:32:02 +0530 Message-ID: <1532358123-23485-4-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> References: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(438002)(199004)(189003)(8936002)(81166006)(54906003)(103686004)(4326008)(5660300001)(81156014)(8676002)(106466001)(110136005)(106002)(50226002)(72206003)(426003)(36386004)(478600001)(48376002)(16586007)(50466002)(316002)(42186006)(305945005)(2201001)(63266004)(36756003)(2906002)(14444005)(6666003)(486006)(44832011)(52956003)(90966002)(126002)(476003)(2616005)(336012)(51416003)(26005)(6266002)(446003)(11346002)(47776003)(356003)(186003)(76176011)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB094; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT034; 1:BSuX7EvV0PGq44SmlxvWGq8O05P0ekAcNwlnEaHpws7AOb4UlB48f/TIdVTYjhwnw4PSp6asvTzNwvkKt0907+pzEGHeonG8y/OJTeyF0Im9Csgjjn/KiMsf7Q3MrjdS MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 302f0686-fb53-418b-146c-08d5f0ad5416 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4608076)(2017052603328)(7153060); SRVR:CO1PR02MB094; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB094; 3:B4viRlo9cxgnIOIhVmIM6Mfng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0DpfSDn+ROV0kxD8AR4Xx1VL6rB29BZd6vqtN/zZwqH5DQ9JuZmMOvRDkL4wHa47u4G6jd0Zx134nMhemNeHvzWChLMNcbTLEkzvDB8+cI86eynejckl0mQBX1fvqLWciq69IbmDgHbHr/2tC/XdMKR2MgoEwCXF4MvI3EcynGKhAK8T+vuuQgGexw3vTm8JfSXZBQYIX/lrbWNJAyM4AHniUtc//S2gA4n4MyRxVSzFlwIa14+/pCELP7Z/pwHVakg+dTApzh7cNYta9kb6299TW2Jt6MO9zcY4q3TEV38bRaoETW1XWEjBx3DC/v2MK3cnePwVVgO04z+0avicDpgyKuCfBrSqdTdMzDNP6GeRYyp7wTQtkF29UYu29uspIkN3T6Hy921MNa/k5GEVzpznaCICJZdtI2B76fcEX1Cyqd X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:CO1PR02MB094; BCL:0; PCL:0; RULEID:; SRVR:CO1PR02MB094; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB094; 4:won8WF2qujddC3O8PL9i+EpagOOjVFhcJILSGUPVlkE1tILpfobXiUjxrhtR8gGRG0tdmyDrHkiP5NIyIwR0ylHZFGbbbY67UaJMpqVrYq8yH5cmBQ0zuPwuzAe4DczwIg5fQehtGnAGw10P/Vpp3aEjKRbcEzg8EbtWY7Qvk5Mo0GaM75QKiCIF8yz7T3XIASb+nJR5AVXHYzCpdLjO6QiVNUt9eRkQoDF0BL1Dc3dVxg3zj1uitNQw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ns6PQ/uN9ZiLAhIo8zHLmZTsV3EE6DIkbax1z8tsNoO4eufTcTyp4s9P5CHVvgYy+nNbg32A84c4xhVHEf0gKQ==; 5:ehHw7nLao0tTCrR9BQjSMlK4sWIGc6Z8b/442v4aHVlELrov/0pewgtsor1K4G6Fkbg2qjflr0IYnDCq+tpvLxMCoVmjyp9wfjtuORbV5nZPTnzjZNvuF5dPLOA6Wwfyz3CwlOtw7yeLoYNRUwQoAF6JewogfDpczVSJ/jMGcBg=; 7:rpuCs+Qa6gy2fCpipKxpF+NZ+Bn8b7+vPqY0KArbn2+m17wUAEf3TygOZtW1Amy2zIsvfRW+eu1B65E5Fmen57OVIP9MVXIIOU42eVX2lHD1FbRHY9Dg1UnTyMfYhjRXgIeSxaTpnL6rQ+yDUwPKxXF1TFyOKf18IJw645EKw3h0urLy65vQ6sHwpK5Kv+NVHws9vgfFrkqRYl/WWDFs/UPSRmg6ML+nwOP+yHHVmZSQLwY9FIy7qq+H+CpApQYC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 15:02:37.0253 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 302f0686-fb53-418b-146c-08d5f0ad5416 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB094 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_080254_891566_C75E2212 X-CRM114-Status: GOOD ( 10.64 ) 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-arm-kernel@lists.infradead.org, sgoud@xilinx.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, anirudh@xilinx.com 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 This patch avoids getting irq number in xadc_remove function. Instead store 'irq' in xadc struct and use xadc->irq wherever needed. This patch also resolves a warning reported by coverity where it asks to check return value of platform_get_irq() for any errors in xadc_remove. Signed-off-by: Manish Narani --- drivers/iio/adc/xilinx-xadc-core.c | 10 +++++----- drivers/iio/adc/xilinx-xadc.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 0dd306d..44a2519 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1175,6 +1175,7 @@ static int xadc_probe(struct platform_device *pdev) xadc = iio_priv(indio_dev); xadc->ops = id->data; + xadc->irq = irq; init_completion(&xadc->completion); mutex_init(&xadc->mutex); spin_lock_init(&xadc->lock); @@ -1225,11 +1226,11 @@ static int xadc_probe(struct platform_device *pdev) if (ret) goto err_free_samplerate_trigger; - ret = xadc->ops->setup(pdev, indio_dev, irq); + ret = xadc->ops->setup(pdev, indio_dev, xadc->irq); if (ret) goto err_clk_disable_unprepare; - ret = request_irq(irq, xadc->ops->interrupt_handler, 0, + ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0, dev_name(&pdev->dev), indio_dev); if (ret) goto err_clk_disable_unprepare; @@ -1288,7 +1289,7 @@ static int xadc_probe(struct platform_device *pdev) return 0; err_free_irq: - free_irq(irq, indio_dev); + free_irq(xadc->irq, indio_dev); err_clk_disable_unprepare: clk_disable_unprepare(xadc->clk); err_free_samplerate_trigger: @@ -1310,7 +1311,6 @@ static int xadc_remove(struct platform_device *pdev) { struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct xadc *xadc = iio_priv(indio_dev); - int irq = platform_get_irq(pdev, 0); iio_device_unregister(indio_dev); if (xadc->ops->flags & XADC_FLAGS_BUFFERED) { @@ -1318,7 +1318,7 @@ static int xadc_remove(struct platform_device *pdev) iio_trigger_free(xadc->convst_trigger); iio_triggered_buffer_cleanup(indio_dev); } - free_irq(irq, indio_dev); + free_irq(xadc->irq, indio_dev); clk_disable_unprepare(xadc->clk); cancel_delayed_work(&xadc->zynq_unmask_work); kfree(xadc->data); diff --git a/drivers/iio/adc/xilinx-xadc.h b/drivers/iio/adc/xilinx-xadc.h index 62edbda..8c00095 100644 --- a/drivers/iio/adc/xilinx-xadc.h +++ b/drivers/iio/adc/xilinx-xadc.h @@ -68,6 +68,7 @@ struct xadc { spinlock_t lock; struct completion completion; + int irq; }; struct xadc_ops { From patchwork Mon Jul 23 15:02:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10540493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09819157A for ; Mon, 23 Jul 2018 15:11:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC50728B1E for ; Mon, 23 Jul 2018 15:11:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFC1028BE1; Mon, 23 Jul 2018 15:11:28 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 B13C428C0C for ; Mon, 23 Jul 2018 15:11:27 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=ND3+9ish99j0EwoIUcH1eG9fZFa8Y+fGc9GNYS5PEx4=; b=IC3jOmlalab2Gn /UKA7G0ljHHwpxBQPj/KM5mIs/iiL1VQBLgB2UkjSRykB1T9MoFiApKFvQS4mfLfmaufGb5AwAkk2 y9M3qeYJdBlJglLD29ClkFDJx1iMgROwW5t128gSTCxOcX1wsKFPkgNNcodCnToHkjKP3h0bQTyNe s8T6A9DvqO0qPzqWGMDwOf7oo/5pt2njiGHC9sWo9jdRcF6zAgtIYyyaT3/bQiRPf3h43HEBjImvf b+HibK2ZHNSQdZcutpkSJN7zcxw2269ARl5qLtvnrTKNTfurLbOBDRjG60vaCANbnRxQAyfkZ85Nm qQ6bf+M4x++eWGnMMR0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcUd-0003lr-9F; Mon, 23 Jul 2018 15:11:23 +0000 Received: from mail-by2nam01on0059.outbound.protection.outlook.com ([104.47.34.59] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMN-0007Nq-5R for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 15:02:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rX3TFA9KVqhZ+6V84wbnZOrpq/Jt0dI3vyIIgVW5cpI=; b=oTe43tI9/keGMUrcde/4WMTTKd96eYoTgP8Z3agejthtvE71ygygFIScxGREfAdcDqkOJL+2rEiAFsT5UpHsnt0hFYFtZwAbUtJSuJLc0tKqj6U3YpqpS5wWm27OFE1l3c8tKD8talAYuOxWLgcjRE3eO1mO3kAx1AU1x7MzYFM= Received: from BYAPR02CA0035.namprd02.prod.outlook.com (2603:10b6:a02:ee::48) by SN1PR02MB1629.namprd02.prod.outlook.com (2a01:111:e400:519f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Mon, 23 Jul 2018 15:02:38 +0000 Received: from SN1NAM02FT003.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by BYAPR02CA0035.outlook.office365.com (2603:10b6:a02:ee::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Mon, 23 Jul 2018 15:02:37 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT003.mail.protection.outlook.com (10.152.73.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.995.12 via Frontend Transport; Mon, 23 Jul 2018 15:02:37 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcM8-0001BW-DB; Mon, 23 Jul 2018 08:02:36 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fhcM3-00006E-91; Mon, 23 Jul 2018 08:02:31 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w6NF2L6m002957; Mon, 23 Jul 2018 08:02:21 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLt-0008VJ-2P; Mon, 23 Jul 2018 08:02:21 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 38F1C121479; Mon, 23 Jul 2018 20:32:20 +0530 (IST) From: Manish Narani To: , , , , , , Subject: [PATCH v2 4/4] iio: adc: xilinx: Move request_irq before enabling interrupts Date: Mon, 23 Jul 2018 20:32:03 +0530 Message-ID: <1532358123-23485-5-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> References: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(346002)(136003)(396003)(2980300002)(438002)(199004)(189003)(2906002)(81166006)(81156014)(5660300001)(63266004)(2201001)(126002)(8676002)(478600001)(6666003)(44832011)(72206003)(476003)(2616005)(8936002)(106466001)(486006)(336012)(426003)(52956003)(11346002)(446003)(50226002)(26005)(186003)(4326008)(6266002)(6346003)(90966002)(36756003)(36386004)(356003)(16586007)(305945005)(103686004)(42186006)(47776003)(106002)(50466002)(76176011)(54906003)(51416003)(110136005)(14444005)(48376002)(316002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1629; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT003; 1:7U7KJtSzwAuj1UG75ijutNIDbEWA++D3UgYonzk4Mt30N2pVgbsJ1qDyM5P9j5DoJ/7ozQWdxiU9jZLS3oxcUwRWhvT/4Zvk8QxAknuZ0gYzr1eUFp70lYhMBI/x0fRF MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9556930c-26d7-44c8-7d63-08d5f0ad5415 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:SN1PR02MB1629; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1629; 3:lP4jhCko0esI/9XnsKxwGUkFl+OykHeg1OMl/lAucnmy0duZZ95d3LapTteq3MtH6BBAJzyE2nyfjMukdBQZGkvs84kjPK+8Or0TZrISA215xy2CTrp0WqwMFrRiqLc7Qt2mrNw0VMnHoPAxO8hNo8Wb0rUhrc0dbXTg5ZKzrlPdpqqGgwU3tVOXjs+E1KvHXp/vmcq6/uiiY7SeQOvFoXvG0Oz0TZokLHRK0fLmN6UMomFmkfoekcG2YcGm2BBCHwEuxBOnhoYHpTFmAw7DF11v7O1xDmT4gw216KWWYqv6Ohper2F6xjXSQe8IgXkP7hi17kt/JEfd+cjH+NuriEuFs51t2lXXbFosRNcVLg8=; 25:XigkKBMO5morrljDyoGPGilYi91jCkK4GMDPBx3t6wRcR/onOVlLayXZsXlZvTA/hlUP8CGOeunoEiXPwiksFEvpo3jBFy/v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Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:SN1PR02MB1629; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1629; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1629; 4:qzpR+S3zsPt4iKk63E6JD2P2ruVCw1pP+ng6vjACbA8l0x2Kz3Nb+FyPaVP520g05jzVs2zDKcHwWtFQo7jhz+TLr73hhYJVUCC/G8dy4c13oA1Ga+PloQ7HQLTWO9VY7WgOCrcZ/qbU3tmCEYRoqYKBy2MPF+M5RkETKcgFLQIwCYI1AoZ+1XSd+gERHla7/9NukDfN3O41maVzQTG8a8NS9dt3QP4E6ib1mz48DEwE4sse8MDPX9+ivt6oz2Aveh8M9tdWV89F5/ZkAkf3DxaqFXs/8sOMFzX+Pi8XmJMw+/qylVWQplgq/JLxtI/g X-Forefront-PRVS: 0742443479 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR02MB1629; 23:eNCqntKzY5KEPQAvs9xXW+TLj6OI2LCBSp3EJIQoV?= Jn90mosddNJhokV+T5FPCgC+jA/v+ZFZNKTzbESYocWmLP2ijSDb3h0X2Xd0ewgzqkErPxRm5jQhtAsUtsqdKB+tYZuDktrnKwPZk6oDf3ipzC+lPoANp6+VmdreZ9FWTmDyz0YCLTeTuSi7jRpf59mSFsPby6XvnSL/jdhq+nCNXtB2ny4lak48P78Uz9LP6nkfHBYCEFchWWpb77w9WigzEWsHWPFp+rUmhHUfm4x5cf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NpG5Ji1nsIA5GnkvRJRR2qyp/JGG2j74o2jioNDbfl0ozKnJ4Ei70Xn85lcRCb8XunQ/UeqTraAfu95RP1AizRDhRAdReefC8Ku+2ey/Jnr5bcfG4hEnBbKCwqDZV0feEqd+cdXqdrdMbqZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 15:02:37.0683 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9556930c-26d7-44c8-7d63-08d5f0ad5415 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1629 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_080251_425451_13F211F0 X-CRM114-Status: GOOD ( 10.08 ) 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-arm-kernel@lists.infradead.org, sgoud@xilinx.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, anirudh@xilinx.com 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 Enabling the Interrupts before registering the irq handler is a bad idea. This patch corrects the same for XADC driver. Signed-off-by: Manish Narani --- drivers/iio/adc/xilinx-xadc-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 44a2519..3f6be5a 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1226,15 +1226,15 @@ static int xadc_probe(struct platform_device *pdev) if (ret) goto err_free_samplerate_trigger; - ret = xadc->ops->setup(pdev, indio_dev, xadc->irq); - if (ret) - goto err_clk_disable_unprepare; - ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0, dev_name(&pdev->dev), indio_dev); if (ret) goto err_clk_disable_unprepare; + ret = xadc->ops->setup(pdev, indio_dev, xadc->irq); + if (ret) + goto err_free_irq; + for (i = 0; i < 16; i++) xadc_read_adc_reg(xadc, XADC_REG_THRESHOLD(i), &xadc->threshold[i]);