From patchwork Mon Jun 17 13:50:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700886 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9526C27C79 for ; Mon, 17 Jun 2024 15:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nJc1oHTHUhBETRHL3c1nje1bxd9wuTSKHCprwANWEcI=; b=3TBLXM7RapMIme X1NfL006g4WDuRh7kf9Gcy4OPzevDR4vhC+uxOFrN/vm+9WQTm9YJFq7WNjb3vVBqoFLR3LH/VaYU vRlbYRIPSFN0Dy9YjjSW4ArDxwnAtj0Ib+vCcrncCGWr5Ngfdml0pyDuR7mqT7so5D3oDAqpZNXCY uEQw+TRfTHLZ2ow2lVkNhfaQPGkCZHwuQGrXzBx2TxSJr7u6SUzDPhSQHnA5DznZJXJD9IrO8dZHi hdKD0i6wP8fZAxzNQPMZD8hkUgejzFuLFLuZ+/8/VgBEnlmxauDKEvztAjxVIRgzt4hHU2rNBtE3I e95Ct3X/Xdi2SHMMgCCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDra-0000000BKhe-38Oe; Mon, 17 Jun 2024 15:01:42 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClK-0000000Axrg-0LN1 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:19 +0000 Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4415e623653so39613461cf.1 for ; Mon, 17 Jun 2024 06:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632268; x=1719237068; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Tvabn+RMpG3uovvK1+JaZOuuhTQ0Y5v5qxh3XvN8Rq8=; b=dlE1MbUV/3GchDyS0Lmy79A/NM8UfMItarSueaNGHATVC6HWI9X0tNztqcH2VVhvdo BwOy6ExxPHxbR9JE7iqC1yi2DsdXZ1zMXNzxcLf4WDpd8GGFInSr30iXyMLetS8kDL2p KE/WBRX1vyuzJygAnBizDsAMKjjBghuZu8EuyM5ko3Q3fbOteEXLlFO5PyfM9rKwmKEH al2gVyxpjvdJkxdiqgH3TJ9Mbu3MnaTERWKaN7SHZaFnzxQ6hKB+g6s2dMICQgnOS3SS i4a5kKVrFT6zc4Ixe25d/P4nmpqy0FVfOz3srpQJtERk5N0SFNGT1Jyo38INgHE047dy MqTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632268; x=1719237068; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tvabn+RMpG3uovvK1+JaZOuuhTQ0Y5v5qxh3XvN8Rq8=; b=hPAWYduWbuvGsAtnOrau7bITtmk621Sf7aNqzecOfBVvSNLaS2HMd1W9REzKEjNWbB S9ooTEVbqIMsPZxv8KLY9RffnqzX7T5VU1H0FyL59PttsVeTLVdux1g7Y+FVeXoltvaz 1iMDJ6+8b3OstTG2E+XZzG3qmu2nQeBceyOv/xyNhLFhBgiM7fn0DMVMwcIH/kHuzaa+ O7g+kuoDKsM2iFEGgb/QNPSDkw3vydh/XcaUUXKc5sLYVyxaDsOYSejOn1e9yzI+XhTo XOnMN4L2MjPkRfN2BUKQapBTGVouzoGPBdtSpOsVRq5dXXAnI+TIZH/iIW5mAjQ92xD1 dbhQ== X-Forwarded-Encrypted: i=1; AJvYcCUDeAtLKZFOQHWiKa+MVgW03BZeEmI5wxcJ+PJasEgArGVZFVKwYz3AvZRmkFrDmDgCJk1970jSgsPvtKbe3Y8hkYYhUl4dh4IO2/EkyQb8B7I= X-Gm-Message-State: AOJu0YwPZ2+0IQJ21SwjHaiPrXlNxYWdeDdVdb0DlFd87mYcENnXoo6h 9El36mZ2LApbGqR0FWR9DkiGwzmdU8N/953OqMJRJTudHB7Jyw1Lz4U4V1bUBQc= X-Google-Smtp-Source: AGHT+IGCNTX7XI85nrdMwm8HgjdhSBF2upAbofRDQ4N0lo0/7MseIEDdacRNTzR/tFRJhwns3PxO2A== X-Received: by 2002:ac8:71d7:0:b0:442:198e:cb9 with SMTP id d75a77b69052e-442198e0e4bmr132788711cf.27.1718632268400; Mon, 17 Jun 2024 06:51:08 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:08 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:19 -0400 Subject: [PATCH v3 39/41] iio: proximity: sx_common: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-39-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065110_384929_45F8DCD0 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx_common.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c index fe07d1444ac3..a95e9814aaf2 100644 --- a/drivers/iio/proximity/sx_common.c +++ b/drivers/iio/proximity/sx_common.c @@ -111,17 +111,16 @@ static int sx_common_enable_irq(struct sx_common_data *data, unsigned int irq) { if (!data->client->irq) return 0; - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, - irq << data->chip_info->irq_msk_offset, - irq << data->chip_info->irq_msk_offset); + return regmap_set_bits(data->regmap, data->chip_info->reg_irq_msk, + irq << data->chip_info->irq_msk_offset); } static int sx_common_disable_irq(struct sx_common_data *data, unsigned int irq) { if (!data->client->irq) return 0; - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, - irq << data->chip_info->irq_msk_offset, 0); + return regmap_clear_bits(data->regmap, data->chip_info->reg_irq_msk, + irq << data->chip_info->irq_msk_offset); } static int sx_common_update_chan_en(struct sx_common_data *data,