From patchwork Fri Apr 2 18:45:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12181417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1AF5C433ED for ; Fri, 2 Apr 2021 18:48:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDEC561163 for ; Fri, 2 Apr 2021 18:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235659AbhDBSsB (ORCPT ); Fri, 2 Apr 2021 14:48:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:59852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235984AbhDBSsA (ORCPT ); Fri, 2 Apr 2021 14:48:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A439610F7; Fri, 2 Apr 2021 18:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617389279; bh=LO3OK5SaKTZNyAqTbR8Q2YS2+sAo08q4vqxQkYNhS8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N1UMKctfk1fBs1za06fBw/D22ob+3RoqfiA68/3zmf/UVaVH0oxw9Hy5JC8zuu7Se hLdT2FEvY6IiDGhSUqlABYJOV8vaKGqoC9ix/+Dcey6gnVIPs68Poh+kZoa9FlW/j/ xjwZdgd5owrsl8jYeeyyV5VW3p6iQ4dWlxKtjOzNMb+vD5Z4PyXQ70NE0XXpwbzgxB Vd+LGRINIbIW/NYFw6BYevCuPuYEEX3r0i15elpLls5/g7KBPOGutS9MzVrVrcagWe UZEtScBD91BpDrJObb/+vmFmjurGyVskxdkrbUN1DPO29xoigXItHf1BJIscGp1YGj nWBohCm3B6gQA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Barry Song , Jonathan Cameron , Lars-Peter Clausen , Alexandru Ardelean Subject: [PATCH 7/7] iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and disable Date: Fri, 2 Apr 2021 19:45:44 +0100 Message-Id: <20210402184544.488862-8-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210402184544.488862-1-jic23@kernel.org> References: <20210402184544.488862-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These devices are not able to mask the signal used as a data ready interrupt. As such they previously requested the irq then immediately disabled it. Now we can avoid the potential of a spurious interrupt by avoiding the irq being auto enabled in the first place. I'm not sure how this code could have been called with the irq already disabled, so I believe the conditional would always have been true and have removed it. Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Alexandru Ardelean --- drivers/iio/adc/ad_sigma_delta.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index 9289812c0a94..e777ec718973 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -485,18 +485,15 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev) sigma_delta->trig->ops = &ad_sd_trigger_ops; init_completion(&sigma_delta->completion); + sigma_delta->irq_dis = true; ret = request_irq(sigma_delta->spi->irq, ad_sd_data_rdy_trig_poll, - sigma_delta->info->irq_flags, + sigma_delta->info->irq_flags | IRQF_NO_AUTOEN, indio_dev->name, sigma_delta); if (ret) goto error_free_trig; - if (!sigma_delta->irq_dis) { - sigma_delta->irq_dis = true; - disable_irq_nosync(sigma_delta->spi->irq); - } iio_trigger_set_drvdata(sigma_delta->trig, sigma_delta); ret = iio_trigger_register(sigma_delta->trig);