From patchwork Thu Oct 24 09:11:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13848590 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 80F5DD0BB7B for ; Thu, 24 Oct 2024 09:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=WIQ2MP5pDvvYrbfNGj0xV8zPitW4RS++GGpHycvY1/k=; b=JP6n7qInlQHc0Jz9ZkI7lCeUp2 t0OwjoYYJc9A0uBbcs0oOcQS+ieiKYW0fuvUfgEU89QmEFicQuBa3tMpWuBXUrWZ/FkmzRwRtpXlM 79SORZEV16vsuVBokPN0VYHXkxfkC7XUCoYk+gO4sjQqHHeytGNAC5hlIArRuCukvtD4Sef+a+jqd eR118Xyf6wkY7MiEB08eWiS1uwNISPlQcImkm7QQQsslgNW6Eg08SuCd5AX483zRBzlcIUNlPS7LI o1MMr4xpd6fwgHY2t8ce2w5tKNUvffPbnUMysAQwS1P/kALoA7DZ8PN93vNS/IWoG2ZIgVLlnxfQO 8KWm+4mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3twu-0000000HQFw-0xmV; Thu, 24 Oct 2024 09:16:08 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3tti-0000000HPMo-1AXj for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 09:12:53 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37d3ecad390so1278967f8f.1 for ; Thu, 24 Oct 2024 02:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729761169; x=1730365969; 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=WIQ2MP5pDvvYrbfNGj0xV8zPitW4RS++GGpHycvY1/k=; b=08FxjyNqfZX6VpfnJrtEPlYX+KtwQrM1as2sIRIS9DEwArPsk2uq/yuMXFtb4iaNfR CxmYoKjDFrcM/FdKv53tlVQ1ka74pbsHSDSujC4rOBcI46XcnpztKJ2Jv+wLC5X7jbDo DoU2dsUR5r+0mApqutORAQRHGCWgmP0/FKnVR1jexhV69W2VL65IC65cuvDdjA/izyto UptCS7DXFmqZPseBEKnXiaLO2Iib8Ls6M48bQGhCpZ/n3TAg9PJa9pFIhUOQ15/X5h7T EKInbmDCyR10sWA5EON6Nxv0hqjCxfiGKFDig+4maeLyuREt7yQySB2j/R/R4ULrsblr 56zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761169; x=1730365969; 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=WIQ2MP5pDvvYrbfNGj0xV8zPitW4RS++GGpHycvY1/k=; b=nNIylzN1gMTkFqkY7q6XocWwF/XOt2WVr3HeBMPIK/ja5k5PmB+tb6000JuO0qmAkO Ji1tmeKQJdnCj5LmpW9w7T+2Xig6BbAlPmEIlBJ64iS/NUijC83bFHiLfZ6W+ByIUnTm vedHaT2O3KMj8+rd6Idvl1TO7ROSMdkC8YFxRlAoHj7Q/BCav/Hz6Svwm3rAttAriSg5 yKuL068JUsjRCEGWHM+gpQE8IB8pJY1c2rREMC7LvBNtD4s0I7dI8d2h1SbTOVLiS++J REqd0E1aDD2/BMQvksLyKMDRiSYGdStj8aHYMeC9ZGdtdb01sXH6IxMWj5v0nYFqfZgU bf+Q== X-Forwarded-Encrypted: i=1; AJvYcCVfTlTzVvVECvJKEHbE5qH/RFGb9Ihlc0/vFhrq/fvwgJ2cvJFKXelYPyt0y3Is0We+cX7jj9Jn48QdiRj4zQ8i@lists.infradead.org X-Gm-Message-State: AOJu0Yx7+saBJhlSdC4jD5dClSX2w5t1zOAopCKQTtNSQFFEOGN+WI/P eEmeI6/sAXcZL3N4goJhciH2GP+CFumJrday/bTQ7i6wc5DMf3wpALb5Y9yuXAw= X-Google-Smtp-Source: AGHT+IEntWBLa/5dqURskXL/ARSqsAtqEzMl2o5Iyp6sjz8yTHvxrX3rp+R1PtjRMJFP/N8oYDaypw== X-Received: by 2002:a05:6000:c8b:b0:37c:c4c0:4545 with SMTP id ffacd0b85a97d-3803abb4947mr832029f8f.10.1729761168701; Thu, 24 Oct 2024 02:12:48 -0700 (PDT) Received: from [192.168.1.64] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b94071sm10843701f8f.89.2024.10.24.02.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:12:48 -0700 (PDT) From: Julien Stephan Date: Thu, 24 Oct 2024 11:11:23 +0200 Subject: [PATCH 1/7] iio: light: bh1745: simplify code in write_event_config callback MIME-Version: 1.0 Message-Id: <20241024-iio-fix-write-event-config-signature-v1-1-7d29e5a31b00@baylibre.com> References: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> In-Reply-To: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_021250_606818_8C03D29B X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan --- drivers/iio/light/bh1745.c | 48 +++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/drivers/iio/light/bh1745.c b/drivers/iio/light/bh1745.c index 2e458e9d5d85308fb6a13d9dbd845fa03b56a40e..fc6bf062d4f510886f909509d8115f0cf892f3c4 100644 --- a/drivers/iio/light/bh1745.c +++ b/drivers/iio/light/bh1745.c @@ -643,41 +643,37 @@ static int bh1745_write_event_config(struct iio_dev *indio_dev, struct bh1745_data *data = iio_priv(indio_dev); int value; - if (state == 0) + if (!state) return regmap_clear_bits(data->regmap, BH1745_INTR, BH1745_INTR_ENABLE); - if (state == 1) { - /* Latch is always enabled when enabling interrupt */ - value = BH1745_INTR_ENABLE; + /* Latch is always enabled when enabling interrupt */ + value = BH1745_INTR_ENABLE; - switch (chan->channel2) { - case IIO_MOD_LIGHT_RED: - return regmap_write(data->regmap, BH1745_INTR, - value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, - BH1745_INTR_SOURCE_RED)); + switch (chan->channel2) { + case IIO_MOD_LIGHT_RED: + return regmap_write(data->regmap, BH1745_INTR, + value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, + BH1745_INTR_SOURCE_RED)); - case IIO_MOD_LIGHT_GREEN: - return regmap_write(data->regmap, BH1745_INTR, - value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, - BH1745_INTR_SOURCE_GREEN)); + case IIO_MOD_LIGHT_GREEN: + return regmap_write(data->regmap, BH1745_INTR, + value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, + BH1745_INTR_SOURCE_GREEN)); - case IIO_MOD_LIGHT_BLUE: - return regmap_write(data->regmap, BH1745_INTR, - value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, - BH1745_INTR_SOURCE_BLUE)); + case IIO_MOD_LIGHT_BLUE: + return regmap_write(data->regmap, BH1745_INTR, + value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, + BH1745_INTR_SOURCE_BLUE)); - case IIO_MOD_LIGHT_CLEAR: - return regmap_write(data->regmap, BH1745_INTR, - value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, - BH1745_INTR_SOURCE_CLEAR)); + case IIO_MOD_LIGHT_CLEAR: + return regmap_write(data->regmap, BH1745_INTR, + value | FIELD_PREP(BH1745_INTR_SOURCE_MASK, + BH1745_INTR_SOURCE_CLEAR)); - default: - return -EINVAL; - } + default: + return -EINVAL; } - - return -EINVAL; } static int bh1745_read_avail(struct iio_dev *indio_dev, From patchwork Thu Oct 24 09:11:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13848591 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 340C4D0BB7B for ; Thu, 24 Oct 2024 09:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=duITNe75XLdkXVHfqcx4G37ll9Oas4mILkoMai22Wuk=; b=QXbI2y/UpNsLeMZfn6CVkzppXD tzZQMDLprhI7iueoMVOU4OT4PcHv+Y4np2IouBz2Y44hIcXJ2fkTX6EoJj4lW0ZQYedh3FbgI1fTr aWqqmmuWCrt2o2iXenvlMxpY1CSWwRQROzAPF0gLhC7JYI+0l4rCRUXDhUh4mh9GpX2RTJ1uvy3yB KWM/h+LqXbJI5qfYmlObBJYIq/rab5hnuKN7NtqfJYrVABcNuMSrZNdZp3DFZfE/DfbjIExzNfBnE C7EvDHmEjkbpPu4OPWoMwAPQoMkSYVXxCeuLSbwKqBtIO7QYNFSg0uuBv3DhTngwKtoiXoQzv7kQw b+Yv9mxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3tyR-0000000HQYC-2dPQ; Thu, 24 Oct 2024 09:17:44 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ttj-0000000HPN5-3Vjt for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 09:12:53 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-37d4ba20075so428839f8f.0 for ; Thu, 24 Oct 2024 02:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729761170; x=1730365970; 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=duITNe75XLdkXVHfqcx4G37ll9Oas4mILkoMai22Wuk=; b=RTx+WgEXjldUORT9LKusVpGSA9J1PZmf2BFJvpZoIbVxXyeLJkf8iQ2ktJOZZc0t1i musXNGjxtiHkAusOdg/qGgZ5P9SrOl/wBvj4T48f4Ar3eQVvEgCoqiYA9xDvV3j1JgEo Hc6yR5gT4+AppDi/PZ+BrJxKjlZdwBzCxm73gZ/tO0uLzypF8/n/+wZ/A/fSp4YivpJ2 xoiiqGSQKtW97UmtjvdvvnSp9HCEv9PmuWSybanjqi5/eVaeM8Jr86j4JZW0MOrz8Tea 3m8hLAYpYT1w4VlUXToCs7dXAWGzuRhgzVkkJNpN0pBElFcnATFgmpVG9w0ju1tqXodC JO3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761170; x=1730365970; 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=duITNe75XLdkXVHfqcx4G37ll9Oas4mILkoMai22Wuk=; b=ngaFLsbJt4e8zYdh6EMKF4vFB9axmKC1uJHe22S1QVHJ3S9UVkI7728GTZzcm0ZjQl nY3aUQC2R0dLZREUFXbl74GPagI8fHXait3WyWflZ8z4aUVEXHcGu0ircs9i/0SqYxyM u0rbvzng33mD/Ctw5cth9dWJnXFWlLBP1zqtZU8DJhphWXd5v/L/c5rwoWvMN6HT2X+p a9x9+2mwK6v5F/FJmPIVJ/MmW79Zf1aOrwUSTAxtuxGvaZK8Jtq2EBZBJVAv7zaLMpzH nno492u/DcpjIYbbLSsOciSvT1oVw/rFtp7a1fw/uDB9loaYorZCry5fLhDBwJzZo0Ju AIJA== X-Forwarded-Encrypted: i=1; AJvYcCUolJ1x96WEvcLS/TvD4BMS6isFges1KF4Q5aoIv2jLZCZKUpFkXuSPOlNtpif1XhoPMKEGkU8gqiFlu+E7pV7T@lists.infradead.org X-Gm-Message-State: AOJu0Yzwlj+bm08Hi0Jnr8LMOcNZtSFpSJLE5iG+FKPpaYNpuzO5mmK9 qnTSEvjY9Fia8bvbPLYC3Qg6riyGuLo310WNEw/p8tLTFpE1sX+beTMFkajQnF0= X-Google-Smtp-Source: AGHT+IFd+bjGts93b5OuoBtQQABH8NKlASdqk/65SlHR44FOjuSVpR7GA/iovKo4zKUodKx38sL06Q== X-Received: by 2002:adf:f7c2:0:b0:374:b3a3:3f83 with SMTP id ffacd0b85a97d-37efcf85335mr3594577f8f.53.1729761169925; Thu, 24 Oct 2024 02:12:49 -0700 (PDT) Received: from [192.168.1.64] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b94071sm10843701f8f.89.2024.10.24.02.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:12:49 -0700 (PDT) From: Julien Stephan Date: Thu, 24 Oct 2024 11:11:24 +0200 Subject: [PATCH 2/7] iio: light: ltr390: simplify code in write_event_config callback MIME-Version: 1.0 Message-Id: <20241024-iio-fix-write-event-config-signature-v1-2-7d29e5a31b00@baylibre.com> References: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> In-Reply-To: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_021251_937880_805EBF0F X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan --- drivers/iio/light/ltr390.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iio/light/ltr390.c b/drivers/iio/light/ltr390.c index 8e0a3fc3d923a6f65d2a629c87e7bfd35d82a507..ff6b5d8b582b33eba60b769dff529caa00fb7244 100644 --- a/drivers/iio/light/ltr390.c +++ b/drivers/iio/light/ltr390.c @@ -558,9 +558,6 @@ static int ltr390_write_event_config(struct iio_dev *indio_dev, struct ltr390_data *data = iio_priv(indio_dev); int ret; - if (state != 1 && state != 0) - return -EINVAL; - if (state == 0) return regmap_clear_bits(data->regmap, LTR390_INT_CFG, LTR390_LS_INT_EN); From patchwork Thu Oct 24 09:11:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13848592 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 2B0DED0BB7C for ; Thu, 24 Oct 2024 09:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=RdOPmGMXx+g86q2x28kwH3RDTuMEma+ZJf3qhTRWEDw=; b=ZQyUDTFHRKexu7ZyAaG7n46e/k DxD/hoH7wiFlCQyIaeyIQFPO+GtmhQl8EIlbTTJIxH1RoURbLDY6H7sVsb29d7QJ5tE4wWBs323wq g2DUz1IpKJWAu5De7acZXOZaG83nMawXQreAoI76YvC8nv864kgjnAG2qAz1SYUCnshjn5OhXFqBi HztnrO0DOHkQ3Jb91Hk542n8QX8xrSBIM54XyFPX97VNcJwVDdEvjHLc33U6/58D0G6e4VTAlcbTT y8LPFsGhMs/vXVYq8rDX1QhEXKG+HELM014ep0dR3cwQ1r956easp4r5w22ExaANmy/9aqR2wXIgY /kj7MXBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3tzx-0000000HQjJ-248l; Thu, 24 Oct 2024 09:19:17 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ttk-0000000HPNw-2j5Y for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 09:12:54 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-37d4ac91d97so556024f8f.2 for ; Thu, 24 Oct 2024 02:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729761171; x=1730365971; 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=RdOPmGMXx+g86q2x28kwH3RDTuMEma+ZJf3qhTRWEDw=; b=M0O/eydfmVgrValfvrNOrD6iC57KxhD9hlMBqzQbpbCecVBG3jU3zDwhgbSuSpmOxD 1Q5MU53B0mqf20SKMTu99shJixzc2BrFZ+Y7eq3t4DOTXx+Ef0SKrI3gX2SxnCN9DTPH IirO5T1hfNpX9Hxak9fAvywkY6bro2v2rSkYCEkneIiO2BPDM5Dl35+fH1gRCyD8iIJg IeA9UijMCgOX/L2ecKsem2lPymLnhV+J29pyZKX6sbTEPCqMgdXBW3J8CLTxds0cP+2h sWECAbBffe8M5GiB/HepMvniS32ZcFv1xHHxr0eDuMKlFpw+5Nz+gqamHEC8qo8g7NVA inxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761171; x=1730365971; 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=RdOPmGMXx+g86q2x28kwH3RDTuMEma+ZJf3qhTRWEDw=; b=EnaLEFFdb9cacJaftfC+utCrP/BE9cHVUHh1nAYomWJGKBpuIrqLEuVmxiOnVhtwyY bjnZ3RyV5WDE+z3ez9QiodwdyzEKZi3HtmNgveYHRbddCZFbPMc3M+/cPMuMzBIjfD87 L03MrFauGBBqeD1Rqy6yDQRo8H5jJjLCPIg6Sf7iWbPFd90bDMVRbshiHAzOtjk3Mm4x M+UyNtGIBKa2a3BQwVn6UD0/kPkgM/sbjQkzB6umLPhYH3PGjTkViqfn1pLJhLSYs8N3 LDm6Bc86X7NzjpfedSSMh3xgbSLxmXwXhXAMvsqAlBVmDR75N9rPqgaR29V/De1xKylI 3zwA== X-Forwarded-Encrypted: i=1; AJvYcCXEcUmYLzCp1SFAuCMjiObqM+Flu1mTtWZCSwMvwlpS2MdwToYG/EV/YNOk/iIFZJf1OXIfUcMKdP7AJ7kNrlx1@lists.infradead.org X-Gm-Message-State: AOJu0YzoikPqDcnIPp6RjIjS8syGMyisrYRTreTSGYk2FjEuQ5q48sOR 83fp4Yy3GYwWHRHH/VtEXxoRfE86Sl097cAu6vvSO9A0rnj6cCxQmvanLcBKPRw= X-Google-Smtp-Source: AGHT+IEJMo4HXjFBb2HAgz0IHf1OOTvuQTF5X6gInGGPV/HyBWXnP/yzVC8dnCAhyj14nu5bNPIoqQ== X-Received: by 2002:a5d:5747:0:b0:37d:48f2:e749 with SMTP id ffacd0b85a97d-37efcee8c46mr4654386f8f.10.1729761170851; Thu, 24 Oct 2024 02:12:50 -0700 (PDT) Received: from [192.168.1.64] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b94071sm10843701f8f.89.2024.10.24.02.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:12:50 -0700 (PDT) From: Julien Stephan Date: Thu, 24 Oct 2024 11:11:25 +0200 Subject: [PATCH 3/7] iio: light: ltr501: simplify code in write_event_config callback MIME-Version: 1.0 Message-Id: <20241024-iio-fix-write-event-config-signature-v1-3-7d29e5a31b00@baylibre.com> References: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> In-Reply-To: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_021252_725894_C124900F X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan --- drivers/iio/light/ltr501.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 8c516ede911619bb4ee8f8a823f242b7aaa6af55..42daebd6023456098dc4bcedc3fe3a45f9ae5be0 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1083,10 +1083,6 @@ static int ltr501_write_event_config(struct iio_dev *indio_dev, struct ltr501_data *data = iio_priv(indio_dev); int ret; - /* only 1 and 0 are valid inputs */ - if (state != 1 && state != 0) - return -EINVAL; - switch (chan->type) { case IIO_INTENSITY: mutex_lock(&data->lock_als); From patchwork Thu Oct 24 09:11:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13848593 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 DAEDED0BB7A for ; Thu, 24 Oct 2024 09:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=xPO7uddPmJGeRvDQ4DDNm675wgeGPQg+TX6wZtIY7Fc=; b=PE4Wz9xBHhXSNqQPcpx2ADuLMl FVgfAoZv8zF07hPABYnMWQlEK6xv3zs7RWr4bAqi68vpuUE1bffenuEXfblMxxg6w1gJIMtu2hodf /my8RrKczIDlpXar6IgHTxdfgsqglzpOXpDoxhZZdYMQ0lM3ozreTxilZ56C/3/N6KuQVP+19V4ip LwX9jK3yXR7tabxHI8aP+R22XhVmwfLtb622Wg1Co7nk4Xs7IIkCz6FgHC6/IHrR/0ZOcbl7uhf6J zJPY9vDdxWY/Su0jy+8V+eR1rwgo3LJ+LqVce3k7E86n77xNRbXzDZQYF7Bc/yVA/lKMOkcGcadnP W/tt/BBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3u1S-0000000HQsl-3rt4; Thu, 24 Oct 2024 09:20:50 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ttl-0000000HPOQ-2JUe for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 09:12:54 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-37d495d217bso554250f8f.0 for ; Thu, 24 Oct 2024 02:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729761172; x=1730365972; 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=xPO7uddPmJGeRvDQ4DDNm675wgeGPQg+TX6wZtIY7Fc=; b=YypSoFHKmFIpj8dsnHyd8v7i+3vsDy9lzTWWirjY5tbyldjT40SP2d00OvwgHjIKK3 D86npQK5XNgc0WUsl7nFKUdDuFwvVr2VM4kUu1GZQWwpyGn/tjdNcOpc5LX7D6uVm89R 1LjU0/f9jsj2795mRkoqIOIfe5fZKsvo0n/MvLM0zmZHYvZyhpE+Kdj4j+2OsrZbIzKe d0EsCXjWRR0KqzZaGbSfxtZliiCuUcmliBNehiQ7+fpeh1SDgtrBrleUBWFgctuG6SN7 DurMGIepH0zzaRr9td7jDlocZnGJsc4nO8SYD824Q1WBfVT0llQ3NCCKIVjoTTaiOvsB cEwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761172; x=1730365972; 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=xPO7uddPmJGeRvDQ4DDNm675wgeGPQg+TX6wZtIY7Fc=; b=RGhwTa8NdDc1Wfmm1S1yN5qg51Xo3h/P95PCtSavBusX+efyFN/KNMlWMhq45dkl6D /FKbpunXa2hcuwrSYZrT+RzSyY/0UR2zR3a1tknT8VTxLkT0nknw903uMkYuRK4q2GW/ j6/z6CPGona2gV9Qx82yeOmloKAX8qn3TqG24Wo8LNI6zyt7bSXiPr0oTNz5wV3nrjD+ OG/7EQwdX8SLkeq4CNXAOSLZHUj/zGzr1ibxDvAUveLNxbbs2hDIVJAGtYR8l8qjMgb7 4S4cm0WdCjiij6gUZhvO8KoBU6JOjN7KWvKJBqXKbKiORdP8dDn/zRZiU+y8cAo523vQ HXDg== X-Forwarded-Encrypted: i=1; AJvYcCU8Ta0ckwgmzFs4wXWESvo7LiWcSHad/B9CNNFEK9x1wjby+nzISi4n2nQZFWdEjp8aDAjkzAwDWv3AvjZBO5fQ@lists.infradead.org X-Gm-Message-State: AOJu0YxkADzzMWkXnECWNFFL8IiXwxT3/nkTFPwa3hm0/uqJUl4hENiA +/xdWcJ2kStjv64ic8X/nCRuI6WmEPO767O0a7C7B9GQuPrmyJ4Er0AY4hzz+jY= X-Google-Smtp-Source: AGHT+IGaN73d/bgLeVCGlsGNxd+TOv2AHPR97BWrXwTr3MwJBwZ4zF+VJDI71VQ8iFHk0s2jf5QZwA== X-Received: by 2002:a5d:438d:0:b0:37d:5042:c8de with SMTP id ffacd0b85a97d-37efcf06011mr4293964f8f.22.1729761171775; Thu, 24 Oct 2024 02:12:51 -0700 (PDT) Received: from [192.168.1.64] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b94071sm10843701f8f.89.2024.10.24.02.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:12:51 -0700 (PDT) From: Julien Stephan Date: Thu, 24 Oct 2024 11:11:26 +0200 Subject: [PATCH 4/7] iio: light: veml6030: simplify code in write_event_config callback MIME-Version: 1.0 Message-Id: <20241024-iio-fix-write-event-config-signature-v1-4-7d29e5a31b00@baylibre.com> References: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> In-Reply-To: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_021253_636537_375A728F X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan --- drivers/iio/light/veml6030.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c index d6f3b104b0e6be8e095a1ad9f20acb81ce492630..95751c1015909cd80543a559673f435d1a168f68 100644 --- a/drivers/iio/light/veml6030.c +++ b/drivers/iio/light/veml6030.c @@ -826,9 +826,6 @@ static int veml6030_write_interrupt_config(struct iio_dev *indio_dev, int ret; struct veml6030_data *data = iio_priv(indio_dev); - if (state < 0 || state > 1) - return -EINVAL; - ret = veml6030_als_shut_down(data); if (ret < 0) { dev_err(&data->client->dev, From patchwork Thu Oct 24 09:11:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13848594 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 1F1F5D0BB7A for ; Thu, 24 Oct 2024 09:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=HpXwrqa5mh4an1VW52USOlgjMJ2X4POeKu7/qnEQ85Y=; b=U7P6A2muu7+YX/DDDAEa7PI01S d9jPgbPguXKdj5Qgs/GUqKrscfhQYAwdJsMUVsH9FTfrfZqx7XAHLKgi8rj8t1BMqQ5lV7WgJHVPP cvmQCUm6R9bPttQpc5srzpEE5QairW+8hDANUU6+JPdi1igc8O63K19rcJDVVu8IAqvyIGD1ExE9B oC5W1P/3VIbNXnFUvdZw4pln48HG41lZnxZNjkdif3UC8yh8HP7XyaOxWoNGECHH5R3qSOLB3rhEY csHeCIFP2/jSzyp2ql6XlCB9tVC+BDz+xGVUza260RCmxYFALs1ia3zYbjswFpawCFfdx4KZ5Sxfd ytCsV/lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3u30-0000000HRFc-24Vt; Thu, 24 Oct 2024 09:22:26 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ttn-0000000HPPd-0P2P for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 09:12:56 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-539fe76e802so803555e87.1 for ; Thu, 24 Oct 2024 02:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729761173; x=1730365973; 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=HpXwrqa5mh4an1VW52USOlgjMJ2X4POeKu7/qnEQ85Y=; b=LYw5rY2ERbbh68zvb0Q7g9h6YpdxnkB80Bxx025CW+DSLsTmaJddAvmgAzrySb3is0 YmSiKDXQDFgQZPlEE+abmLTEbrxO2dUIBtsMY3UNqU+HBQq/gKjhlYRAceR9oVBmywPU 9UOu1nenvc/sNy66KChfljNxfczpdxtky5Vt79fqo2AN6MzHA/HgAyC6tyP5n8kF/sdg XLxeLgg+PuzWEG7oHCj+cmjzoCTNccmA/fb3N8XJWN5f1DO2kWCoWKddY+iN8CeennJ5 Xk4X/xK/zYQtyD/qYhHUWO66n+MoaVhyObdvo7URspBHrUdcXK82fKiCDDqyUPEYnLYw gKZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761173; x=1730365973; 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=HpXwrqa5mh4an1VW52USOlgjMJ2X4POeKu7/qnEQ85Y=; b=bneapqVQsnpFRjaDbxLia4h3jrQ2aUD6JcHQpLtN+utbWkjbBdMw5n2Y/nyJrM3byN ou7vTs16cDdLuyZCgn4AFvaOloIsAaK1zgkca3cQZFwJb8aXjnY1OiaXAui46x7CRNc5 ZLp2Qi49vhgwgZua2+iJnH8/g4G/VzgjllHEiNoT5sJ1qWyX0ijCBCiQEcdTBP8Fjpml BTNgMEPZrtBbrFZd/1npaJIXEqAfaIY7Pncywlo35Wdr1TQgTalMTfmspp0UtkxiCVl8 8eNflwvlhVRsuxXDdW9BLImS5HDBnP+ojh1lHOLaAfvxqXvH1UDwKbhuPsOgvL0gH+2V 4cfQ== X-Forwarded-Encrypted: i=1; AJvYcCXKOCmHph3/13FjXwMDCwbx/q+zPbs7OhRyYFAzf26w/pekXixKlIMQFy7gdalrGeCP6JZA4+u2A26xRoGVNVyr@lists.infradead.org X-Gm-Message-State: AOJu0Yz2gBWtw2ZswSQs7zMX9RTp+INQpMUdLnSGLLp9y2RBKE+hWtW2 qF7CNecOyX4+8NSGvNzN4wzfSNfM7djsuCGyonKLtveEG8HbqlvMLd2LfARuoyvgBGiTvX4DNJA t8IV0Gw== X-Google-Smtp-Source: AGHT+IHjMTzdOejYpXdaJTcSXe71t6xMLTv/MupAWuwwaYamFeQSYvZEYBgJNNUbqbvWU86WqzOMBw== X-Received: by 2002:a05:6512:3a82:b0:539:8b02:8f1d with SMTP id 2adb3069b0e04-53b1a3392bcmr2894072e87.30.1729761173024; Thu, 24 Oct 2024 02:12:53 -0700 (PDT) Received: from [192.168.1.64] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b94071sm10843701f8f.89.2024.10.24.02.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:12:52 -0700 (PDT) From: Julien Stephan Date: Thu, 24 Oct 2024 11:11:27 +0200 Subject: [PATCH 5/7] iio: imu: inv_mpu6050: simplify code in write_event_config callback MIME-Version: 1.0 Message-Id: <20241024-iio-fix-write-event-config-signature-v1-5-7d29e5a31b00@baylibre.com> References: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> In-Reply-To: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_021255_175121_FFE40B56 X-CRM114-Status: GOOD ( 12.24 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan Acked-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 7 ++----- drivers/iio/light/apds9960.c | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 5680be153127711777b6074da18a7a0f86211d6c..21ebf0f7e28fec302cbf8ab890fc53a3de6f36cd 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -1176,21 +1176,18 @@ static int inv_mpu6050_write_event_config(struct iio_dev *indio_dev, int state) { struct inv_mpu6050_state *st = iio_priv(indio_dev); - int enable; /* support only WoM (accel roc rising) event */ if (chan->type != IIO_ACCEL || type != IIO_EV_TYPE_ROC || dir != IIO_EV_DIR_RISING) return -EINVAL; - enable = !!state; - guard(mutex)(&st->lock); - if (st->chip_config.wom_en == enable) + if (st->chip_config.wom_en == state) return 0; - return inv_mpu6050_enable_wom(st, enable); + return inv_mpu6050_enable_wom(st, state); } static int inv_mpu6050_read_event_value(struct iio_dev *indio_dev, diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c index 3c14e4c30805e1b596ef2380f94e6aa3e92082b1..3a56eaae5a68f2891d061871c7013f0b5447bb47 100644 --- a/drivers/iio/light/apds9960.c +++ b/drivers/iio/light/apds9960.c @@ -762,8 +762,6 @@ static int apds9960_write_event_config(struct iio_dev *indio_dev, struct apds9960_data *data = iio_priv(indio_dev); int ret; - state = !!state; - switch (chan->type) { case IIO_PROXIMITY: if (data->pxs_int == state) From patchwork Thu Oct 24 09:11:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13848609 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 E10AAD0BB7D for ; Thu, 24 Oct 2024 09:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=0ExSlIGvQ1qKjNeppy5CslHA0+Ug61+8Wg56jV+Rbdo=; b=GtYeDt4HQ1TV1Ce0/0B7W/YQ09 5fclLjlSskBKbg7vdUwjU3R/cnuhhVNaeBeU0hnuRZq0ADTjUNXqs4h5vkLuAYW/nVs3MnBA9fUHC yawFXkcLjM4phd7V2zh9eBqA93ovLxjw+Hnc6OV08CKQo+vcNqK2emdMPeTrj6OyLNb8JlHfrlQBA 4exnPuRVZtW6GYpVFbae8TqdtzPqk1PD439b6aeUhc+tIaq7PVtYoXM+foWXVZ+I9FtFWitE7/y9F J7ftdu/3eux13ByWd1FYxgdQmhQ3nA0eCA6mlWO4+lqzZh/sKWFjEdwQEHZJ9KWZTNX2ibRYAIq1V KRsAcQiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3u4V-0000000HRQZ-3m1n; Thu, 24 Oct 2024 09:24:00 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ttn-0000000HPQ1-3eml for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 09:12:57 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-37d4821e6b4so407338f8f.3 for ; Thu, 24 Oct 2024 02:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729761174; x=1730365974; 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=0ExSlIGvQ1qKjNeppy5CslHA0+Ug61+8Wg56jV+Rbdo=; b=Nj3Npw3MBia2buvkk/fxCuICjpC7w+zgtBbx3zaVBw6Jw6SQKOR2/+9msNcYi/yGKY ZeEI4ks5GrdeVmP9utoOHwj1queYOlYda7oi3do5sW9qPZZEBN0uEOXAOAwZjiOljSD6 3BvOHXAT8by44OBiz1iocmauBgO4ysDQ5CToIPfblxIf0AiVBfd+CfdvO2tANRXQvzRz 5y+rDoMrpL4N3IZK9HnR6Kif0Fb0w9MS0/98Xhe2ltoR6QE3gCKhj3X0C1EQV3l9KMbF QOMECAVnbM4GpQCBrUJgnGmaHRyqDsg2b7Fc1ZQe8HkvO6Eog496Cg22xftwVf3cSHuw uKyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761174; x=1730365974; 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=0ExSlIGvQ1qKjNeppy5CslHA0+Ug61+8Wg56jV+Rbdo=; b=uLAdhejIcALBwHCe4FXZ8Mpltk24DFu5XG4jraR3WuzjBrjsR7Wnfodhrnukqa8CJ1 NPgZUy5LWwBcLyosJ5zDIvm1C51G3qqscsMUOGmU1c9YDngdQAnWwat1mKn2dXhWyIin qntKW7Ac6tosu9QW3XYthPAvZkYHUmGvTvQOIzoH5/u4m6wbdQSF7iLTapkHHOnZ3N3u VUpRMO9sFeCJfkjvggy4Xo99awJhlejvf+Fy7/ptSIgsSlJ4RdF0pePOzR05qz7X7Pck IRrHzkxqh1cg3gzxCK+lRMAjrQS69JuZFrrUU/jC+47Rbnbs9puswSK7tBMrfZiBEzWd P1EQ== X-Forwarded-Encrypted: i=1; AJvYcCVQsRPkYIEi3zoXATf1V/Z6gGMMf0nNZ27I6FqPpJa4gEwkbkfI1xTh2qE9h+4RJb/pHdvDvbYMIbitNB5e1v+M@lists.infradead.org X-Gm-Message-State: AOJu0Yx6BLEdUrQZw1puUKkCVC80MrumVFU3eICyigp7evZs1Y9Vq7Om slmpyoOJLYA4rhnHEx2H3dFEqCByI0s9PCvEueFzdWfNM256I01YOCOyxiTuOGk= X-Google-Smtp-Source: AGHT+IHssIn5+2M6/mPZQxU0hUVx3UQF3gcvmL8dKPbUHqhz4gdaCpTX+p1XSijdvMnFvDxT9HuOTQ== X-Received: by 2002:a5d:66c7:0:b0:37d:50f8:a7f4 with SMTP id ffacd0b85a97d-380458f3f6bmr784047f8f.52.1729761173970; Thu, 24 Oct 2024 02:12:53 -0700 (PDT) Received: from [192.168.1.64] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b94071sm10843701f8f.89.2024.10.24.02.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:12:53 -0700 (PDT) From: Julien Stephan Date: Thu, 24 Oct 2024 11:11:28 +0200 Subject: [PATCH 6/7] iio: light: stk3310: simplify code in write_event_config callback MIME-Version: 1.0 Message-Id: <20241024-iio-fix-write-event-config-signature-v1-6-7d29e5a31b00@baylibre.com> References: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> In-Reply-To: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_021255_956134_DA01DCE3 X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan --- drivers/iio/light/stk3310.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index ed20b67145463d253a0dff28a4c1c3e02e710319..c6f950af5afa0f77a617bd2baf0a08eef5ec26f0 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -330,9 +330,6 @@ static int stk3310_write_event_config(struct iio_dev *indio_dev, struct stk3310_data *data = iio_priv(indio_dev); struct i2c_client *client = data->client; - if (state < 0 || state > 7) - return -EINVAL; - /* Set INT_PS value */ mutex_lock(&data->lock); ret = regmap_field_write(data->reg_int_ps, state); From patchwork Thu Oct 24 09:11:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13848610 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 0A225D0BB7D for ; Thu, 24 Oct 2024 09:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=YLxfbPq4CkZs4+8Gsej7RO5GcsMllT50vRkVIe/pzdE=; b=Uajv6Mq3G7pw5lgRbJqO5gnTap 4nJeAA/20rHcVeaOuaODavCfohm0PgJSoi5i3GYyI8yd29AM7IVhJbRH4c1aHevmDgyrUObSpNUu2 mc6xxGsZr8ouxRasfjYELkI6Rkr2V3HP8KaljaR3pX/PUKv6kmNsG6J4SdCqc+t42PzXge6xD1Dly BdHPuBDW3QmLUxmyHLs33Uy2KenwK/PQJFkfOkI1EzT347rWqrfgRQ+sYjC+Kv25x1tg52Y+IOOVD qQwZmN3DUgUkx/MB0e490dpO++2mWu7dUKNXw75wABfGWe9rZFfRW7SmeqousOEmoQa5ODWH1WPb1 S0xlwALw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3u62-0000000HRkh-2Ilr; Thu, 24 Oct 2024 09:25:34 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ttp-0000000HPQy-1aUQ for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 09:13:01 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43162cf1eaaso9144415e9.0 for ; Thu, 24 Oct 2024 02:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729761175; x=1730365975; 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=YLxfbPq4CkZs4+8Gsej7RO5GcsMllT50vRkVIe/pzdE=; b=jPCBTUOdbzM5dNYaLzy+f+lSqIqGAMxulSL+VsJR9N9WuFnfQ1YgohQTWju4rz5jD4 WF7TxwqR0FIUPmM1t3ThJXNNd7GNcSp1THsJtI1BwzLuiElyIOOJ4S92C9+QJ7Y5IqTA RxA2STDsya2MJtGhwy8gzKh9whVYTeXuKdG/wLaDZZ5J0nuAB+pWJ3vBJTCM3gORjzdd 36t+Jqo7rKOAzad5L0PV+Z0wqdje111XoUKhNycBCfkBJBYNJW93JPZ3edJRGFQIoBk1 F6fJmJNtEmHKqHDcU5Hrmd9uzpQRAwZu8OOZUpWhhQ3bZWswA+JMkg77XrVmU8THStNT pV0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761175; x=1730365975; 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=YLxfbPq4CkZs4+8Gsej7RO5GcsMllT50vRkVIe/pzdE=; b=bFJMIa6/5mR5S6CtjaQ1IFJAbxyuFqkp2zqoJSFX5VutCNs04J9O89btcv9LwfQ8M7 PIKv1QRi8Fq2kKRPMXyJKp3W/yYZ36Wi51n1MfMgRjr/l4bYEf/j2CvvK4wkoWy2npZY VwSHUW3/k0X6u0BsKrd5QjuiRHMkz3FACzHZgPXnMOxZ/OJEeAKkjc58UOd/scpREf5O XPmejuQiYnunES0yeybpqqt/IGnJcZwh69VWa6xGInWQS3D3cGvlGRFVAb7HFADX1blK vCHaH4+iI9ayz2BVA/Y2vHCtAUjwuQi7rjqVLzkqzjKArjY+QloDCADDjQnfal13Uquw fiUg== X-Forwarded-Encrypted: i=1; AJvYcCUztxQBScgGV0EbN48qsd/tzFyiVYgoi/IWYKBeMW/C/vEQVUf5OXs9CrNIT37hgGnZ/Ee/EMte0KyKJGZBbrMv@lists.infradead.org X-Gm-Message-State: AOJu0YzePPWd2l8bFNa/dbuDrN/iBkgSrTx96vbrolSCd6Nc/x+GQb7y aR+Fh5dC0IBndfyVV5rlqRzwyMGyigAsh1rrkASf0uG8qDREG3FK2VC+Vq/97x8= X-Google-Smtp-Source: AGHT+IFovrcktvX63fkC7wB57hlqqMUooqxj/par2+DMQRtgtkzdUDTnET2XrAvux0HWdz5rVlm1Rg== X-Received: by 2002:a05:6000:1e4f:b0:37c:cfdc:19ba with SMTP id ffacd0b85a97d-37efcf18afbmr4516139f8f.28.1729761175078; Thu, 24 Oct 2024 02:12:55 -0700 (PDT) Received: from [192.168.1.64] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b94071sm10843701f8f.89.2024.10.24.02.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:12:54 -0700 (PDT) From: Julien Stephan Date: Thu, 24 Oct 2024 11:11:29 +0200 Subject: [PATCH 7/7] iio: fix write_event_config signature MIME-Version: 1.0 Message-Id: <20241024-iio-fix-write-event-config-signature-v1-7-7d29e5a31b00@baylibre.com> References: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> In-Reply-To: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan , Julia Lawall X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_021257_495218_ECD9ED98 X-CRM114-Status: GOOD ( 14.70 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org write_event_config callback use an int for state, but it is actually a boolean. iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to write_event_config. Fix signature and update all iio drivers to use the new signature. This patch has been partially written using coccinelle with the following script: $ cat iio-bool.cocci // Options: --all-includes virtual patch @c1@ identifier iioinfo; identifier wecfunc; @@ static const struct iio_info iioinfo = { ..., .write_event_config = ( wecfunc | &wecfunc ), ..., }; @@ identifier c1.wecfunc; identifier indio_dev, chan, type, dir, state; @@ int wecfunc(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, -int +bool state) { ... } make coccicheck MODE=patch COCCI=iio-bool.cocci M=drivers/iio Unfortunately, this script didn't match all files: * all write_event_config callbacks using iio_device_claim_direct_scoped were not detected and not patched. * all files that do not assign and declare the write_event_config callback in the same file. iio.h was also manually updated. The patch was build tested using allmodconfig config. cc: Julia Lawall Signed-off-by: Julien Stephan --- drivers/iio/accel/adxl367.c | 2 +- drivers/iio/accel/adxl372.c | 2 +- drivers/iio/accel/adxl380.c | 2 +- drivers/iio/accel/bma400_core.c | 2 +- drivers/iio/accel/bmc150-accel-core.c | 2 +- drivers/iio/accel/fxls8962af-core.c | 2 +- drivers/iio/accel/kxcjk-1013.c | 2 +- drivers/iio/accel/mma8452.c | 2 +- drivers/iio/accel/mma9551.c | 2 +- drivers/iio/accel/mma9553.c | 3 ++- drivers/iio/accel/sca3000.c | 2 +- drivers/iio/adc/ad7091r-base.c | 3 ++- drivers/iio/adc/ad7291.c | 2 +- drivers/iio/adc/ad799x.c | 2 +- drivers/iio/adc/hi8435.c | 2 +- drivers/iio/adc/max1363.c | 2 +- drivers/iio/adc/pac1921.c | 3 ++- drivers/iio/adc/palmas_gpadc.c | 2 +- drivers/iio/adc/ti-ads1015.c | 2 +- drivers/iio/adc/xilinx-ams.c | 2 +- drivers/iio/adc/xilinx-xadc-events.c | 2 +- drivers/iio/adc/xilinx-xadc.h | 2 +- drivers/iio/cdc/ad7150.c | 2 +- drivers/iio/dac/ad5421.c | 2 +- drivers/iio/dac/ad8460.c | 2 +- drivers/iio/dummy/iio_simple_dummy.h | 2 +- drivers/iio/dummy/iio_simple_dummy_events.c | 2 +- drivers/iio/gyro/bmg160_core.c | 2 +- drivers/iio/imu/bmi323/bmi323_core.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 +- drivers/iio/imu/kmx61.c | 2 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +- drivers/iio/light/adux1020.c | 3 ++- drivers/iio/light/apds9300.c | 2 +- drivers/iio/light/apds9306.c | 2 +- drivers/iio/light/apds9960.c | 2 +- drivers/iio/light/bh1745.c | 2 +- drivers/iio/light/cm36651.c | 2 +- drivers/iio/light/gp2ap002.c | 2 +- drivers/iio/light/gp2ap020a00f.c | 2 +- drivers/iio/light/iqs621-als.c | 2 +- drivers/iio/light/ltr390.c | 2 +- drivers/iio/light/ltr501.c | 2 +- drivers/iio/light/max44009.c | 2 +- drivers/iio/light/opt3001.c | 2 +- drivers/iio/light/stk3310.c | 2 +- drivers/iio/light/tcs3472.c | 2 +- drivers/iio/light/tsl2563.c | 2 +- drivers/iio/light/tsl2591.c | 2 +- drivers/iio/light/tsl2772.c | 2 +- drivers/iio/light/us5182d.c | 2 +- drivers/iio/light/vcnl4000.c | 5 +++-- drivers/iio/light/veml6030.c | 2 +- drivers/iio/position/iqs624-pos.c | 2 +- drivers/iio/proximity/aw96103.c | 2 +- drivers/iio/proximity/cros_ec_mkbp_proximity.c | 2 +- drivers/iio/proximity/hx9023s.c | 2 +- drivers/iio/proximity/irsd200.c | 3 ++- drivers/iio/proximity/sx9500.c | 2 +- drivers/iio/proximity/sx_common.c | 2 +- drivers/iio/proximity/sx_common.h | 2 +- drivers/iio/proximity/vcnl3020.c | 2 +- drivers/iio/temperature/mcp9600.c | 2 +- drivers/iio/temperature/tmp007.c | 2 +- include/linux/iio/iio.h | 2 +- 65 files changed, 72 insertions(+), 66 deletions(-) diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c index e790a66d86c79f7de9650ea47f11c8990825fd42..705375f3b56e653631491a8316a56d0dcb171e89 100644 --- a/drivers/iio/accel/adxl367.c +++ b/drivers/iio/accel/adxl367.c @@ -1073,7 +1073,7 @@ static int adxl367_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { enum adxl367_activity_type act; diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c index ef8dd557877bd44570e84579b1af89e6b02cc523..5b9eb364760a281e8ef0ef15124cc1c8e8b0f58c 100644 --- a/drivers/iio/accel/adxl372.c +++ b/drivers/iio/accel/adxl372.c @@ -940,7 +940,7 @@ static int adxl372_read_event_config(struct iio_dev *indio_dev, const struct iio static int adxl372_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct adxl372_state *st = iio_priv(indio_dev); diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c index 9f6f0a45efce7981736c3a8f005f4fef83f05cfd..5d2bda1a6a783c3f5bf6dfa6830bc80cc7055e01 100644 --- a/drivers/iio/accel/adxl380.c +++ b/drivers/iio/accel/adxl380.c @@ -1386,7 +1386,7 @@ static int adxl380_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct adxl380_state *st = iio_priv(indio_dev); enum adxl380_axis axis; diff --git a/drivers/iio/accel/bma400_core.c b/drivers/iio/accel/bma400_core.c index 0bf5f321cfe79147df01fa674de779e506818b46..906d2577be2d64220046ec56ef675ddafb9a50ab 100644 --- a/drivers/iio/accel/bma400_core.c +++ b/drivers/iio/accel/bma400_core.c @@ -1293,7 +1293,7 @@ static int bma400_disable_adv_interrupt(struct bma400_data *data) static int bma400_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct bma400_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index 0f32c1e92b4dc121bb85516acef4941b0421f100..158579350d596e11ab36d9ea4692e5837cca482e 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -804,7 +804,7 @@ static int bmc150_accel_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct bmc150_accel_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index ab427f3461dbbef535c2ec2cf2982202ca97bb82..f07fba17048e7b5c1958807b14d4bcb3ff87e26d 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -617,7 +617,7 @@ static int fxls8962af_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct fxls8962af_data *data = iio_priv(indio_dev); u8 enable_event, enable_bits; diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index bbf65fc97b082dc92cb19155925c8b2ad3081003..87ac955f9740d310a95cab2109b1703941276ed6 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1064,7 +1064,7 @@ static int kxcjk1013_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct kxcjk1013_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index de4525b30edcab8c786708df98f072d569c81f2e..962d289065ab7bb3da5ae102cb5ee2cb96662af5 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -974,7 +974,7 @@ static int mma8452_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct mma8452_data *data = iio_priv(indio_dev); int val, ret; diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c index fa1799b0b0dff35ccd811c4abee3883249c184da..0656e35a1c4e5c1268a4bbf7011fd9282053dbbf 100644 --- a/drivers/iio/accel/mma9551.c +++ b/drivers/iio/accel/mma9551.c @@ -225,7 +225,7 @@ static int mma9551_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct mma9551_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c index 86543f34ef17cfe9ed092930b07c2418e0bf373a..3c28957b19a94d8a8b6294c50290bb2e0745c7f5 100644 --- a/drivers/iio/accel/mma9553.c +++ b/drivers/iio/accel/mma9553.c @@ -725,7 +725,8 @@ static int mma9553_read_event_config(struct iio_dev *indio_dev, static int mma9553_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, + bool state) { struct mma9553_data *data = iio_priv(indio_dev); struct mma9553_event *event; diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c index 87c54e41f6ccd2f9311653b757b2d794df1dd5d4..36cbfcbba04d6920ba68bebd70d21bc3898a044d 100644 --- a/drivers/iio/accel/sca3000.c +++ b/drivers/iio/accel/sca3000.c @@ -1253,7 +1253,7 @@ static int sca3000_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct sca3000_state *st = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/adc/ad7091r-base.c b/drivers/iio/adc/ad7091r-base.c index d6876259ad14499df0983b4744834d66aa789f27..eb0a059b4b0e9e8af52e9433032318d853a76c33 100644 --- a/drivers/iio/adc/ad7091r-base.c +++ b/drivers/iio/adc/ad7091r-base.c @@ -150,7 +150,8 @@ static int ad7091r_read_event_config(struct iio_dev *indio_dev, static int ad7091r_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, + bool state) { struct ad7091r_state *st = iio_priv(indio_dev); diff --git a/drivers/iio/adc/ad7291.c b/drivers/iio/adc/ad7291.c index 4c7f887adbbf2f2c857288b19ce8058ee5ebdffb..60e12faa32070183c64a2037c968177cb903cc11 100644 --- a/drivers/iio/adc/ad7291.c +++ b/drivers/iio/adc/ad7291.c @@ -269,7 +269,7 @@ static int ad7291_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { int ret = 0; struct ad7291_chip_info *chip = iio_priv(indio_dev); diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c index 0f107e3fc2c85575e6820f995949a5345e9d69d3..aa44b4e2542b2679c6b5fbe7346e3e9dc17721af 100644 --- a/drivers/iio/adc/ad799x.c +++ b/drivers/iio/adc/ad799x.c @@ -406,7 +406,7 @@ static int ad799x_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct ad799x_state *st = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c index fb635a756440300432b0bbcf1fd9ebce2e9ab92d..689e34f069877ec525c5f9ee7258d5140d4bba70 100644 --- a/drivers/iio/adc/hi8435.c +++ b/drivers/iio/adc/hi8435.c @@ -132,7 +132,7 @@ static int hi8435_read_event_config(struct iio_dev *idev, static int hi8435_write_event_config(struct iio_dev *idev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct hi8435_priv *priv = iio_priv(idev); int ret; diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c index 8da2d8d7a9c677c6eb5c4b2903a7954c0105707d..9a0baea08ab6162b024932f3f65c8a68d156672d 100644 --- a/drivers/iio/adc/max1363.c +++ b/drivers/iio/adc/max1363.c @@ -944,7 +944,7 @@ static inline int __max1363_check_event_mask(int thismask, int checkmask) static int max1363_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct max1363_state *st = iio_priv(indio_dev); diff --git a/drivers/iio/adc/pac1921.c b/drivers/iio/adc/pac1921.c index a96fae546bc1e6d1bf3a0dbe67204c191d77a3ee..d65b9248dca8be68baca3a71463979c2321d792e 100644 --- a/drivers/iio/adc/pac1921.c +++ b/drivers/iio/adc/pac1921.c @@ -699,7 +699,8 @@ static int pac1921_read_event_config(struct iio_dev *indio_dev, static int pac1921_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, + bool state) { struct pac1921_priv *priv = iio_priv(indio_dev); u8 ovf_bit; diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c index 67d567ee21b439e3f296c239c68d8ed6f1723b59..d283ee8fb1d2f219674ece7faa5492503671ac94 100644 --- a/drivers/iio/adc/palmas_gpadc.c +++ b/drivers/iio/adc/palmas_gpadc.c @@ -676,7 +676,7 @@ static int palmas_gpadc_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct palmas_gpadc *adc = iio_priv(indio_dev); int adc_chan = chan->channel; diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c index 052d2124b21570e0b90fd4aa4048adcc921301ef..47fe8e16aee42d375a74f9e97d4220542b04566d 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c @@ -806,7 +806,7 @@ static int ads1015_disable_event_config(struct ads1015_data *data, static int ads1015_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct ads1015_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c index ebc583b07e0c00bd08c3219f595edd8df26a8378..76dd0343f5f76a6b1a8882e41d6a7f333c3a36e4 100644 --- a/drivers/iio/adc/xilinx-ams.c +++ b/drivers/iio/adc/xilinx-ams.c @@ -905,7 +905,7 @@ static int ams_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct ams *ams = iio_priv(indio_dev); unsigned int alarm; diff --git a/drivers/iio/adc/xilinx-xadc-events.c b/drivers/iio/adc/xilinx-xadc-events.c index 90f62377c34d97fcf3695103edc4d8e9a17d0a83..c188d3dcab48fea007ac065397bb17f952ca09db 100644 --- a/drivers/iio/adc/xilinx-xadc-events.c +++ b/drivers/iio/adc/xilinx-xadc-events.c @@ -121,7 +121,7 @@ int xadc_read_event_config(struct iio_dev *indio_dev, int xadc_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { unsigned int alarm = xadc_get_alarm_mask(chan); struct xadc *xadc = iio_priv(indio_dev); diff --git a/drivers/iio/adc/xilinx-xadc.h b/drivers/iio/adc/xilinx-xadc.h index 3036f4d613ff5d44018c098781576d3f71fd5b49..b4d9d468311723fa79cfd7f10781f788dbf9c9db 100644 --- a/drivers/iio/adc/xilinx-xadc.h +++ b/drivers/iio/adc/xilinx-xadc.h @@ -25,7 +25,7 @@ int xadc_read_event_config(struct iio_dev *indio_dev, enum iio_event_direction dir); int xadc_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state); + enum iio_event_direction dir, bool state); int xadc_read_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, enum iio_event_info info, diff --git a/drivers/iio/cdc/ad7150.c b/drivers/iio/cdc/ad7150.c index 4c03b9e834b88d6eafabb63999a1ed2c1720118f..e64a41bae32c67e43fc9021c186170c4bacb2ae3 100644 --- a/drivers/iio/cdc/ad7150.c +++ b/drivers/iio/cdc/ad7150.c @@ -232,7 +232,7 @@ static int ad7150_write_event_params(struct iio_dev *indio_dev, static int ad7150_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct ad7150_chip_info *chip = iio_priv(indio_dev); int ret = 0; diff --git a/drivers/iio/dac/ad5421.c b/drivers/iio/dac/ad5421.c index 7644acfd879e046ebea39e16a5566f58e9ceefed..1462ee640b16863e779bb550fa64445b5c8bd72c 100644 --- a/drivers/iio/dac/ad5421.c +++ b/drivers/iio/dac/ad5421.c @@ -384,7 +384,7 @@ static int ad5421_write_raw(struct iio_dev *indio_dev, static int ad5421_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct ad5421_state *st = iio_priv(indio_dev); unsigned int mask; diff --git a/drivers/iio/dac/ad8460.c b/drivers/iio/dac/ad8460.c index 7470d97825e0a6b0124c2a3bac3d5709dcded534..f235394589dfb6ae575e37819dfd33dc35f77f23 100644 --- a/drivers/iio/dac/ad8460.c +++ b/drivers/iio/dac/ad8460.c @@ -573,7 +573,7 @@ static int ad8460_read_event_value(struct iio_dev *indio_dev, static int ad8460_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int val) + enum iio_event_direction dir, bool val) { struct ad8460_state *state = iio_priv(indio_dev); int fault; diff --git a/drivers/iio/dummy/iio_simple_dummy.h b/drivers/iio/dummy/iio_simple_dummy.h index a91622ac54e06e037502fbc956f0bd7c35de7509..8246f25dbad04f2bb612177631ebc1bedfc1f1e9 100644 --- a/drivers/iio/dummy/iio_simple_dummy.h +++ b/drivers/iio/dummy/iio_simple_dummy.h @@ -60,7 +60,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state); + bool state); int iio_simple_dummy_read_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, diff --git a/drivers/iio/dummy/iio_simple_dummy_events.c b/drivers/iio/dummy/iio_simple_dummy_events.c index 63a2b844be50834e232f653bbb893dee29171c4c..c7f2d3a4d60b2602bd180feca7c141b2dd6e35a7 100644 --- a/drivers/iio/dummy/iio_simple_dummy_events.c +++ b/drivers/iio/dummy/iio_simple_dummy_events.c @@ -53,7 +53,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct iio_dummy_state *st = iio_priv(indio_dev); diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 10728d5ccae398d15c1d51e0380306042675d5c0..badc4155b5a0a928c22eb764c0ff9eb8a463a9f2 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -749,7 +749,7 @@ static int bmg160_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct bmg160_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c index 1e6c083ea5c1bbddb878f08cd4f4be725c0e319f..76a88e1ccc1d89988eb52d6b1be8da0f5005f0e6 100644 --- a/drivers/iio/imu/bmi323/bmi323_core.c +++ b/drivers/iio/imu/bmi323/bmi323_core.c @@ -785,7 +785,7 @@ static const struct attribute_group bmi323_event_attribute_group = { static int bmi323_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct bmi323_data *data = iio_priv(indio_dev); diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 21ebf0f7e28fec302cbf8ab890fc53a3de6f36cd..40271352b02cf6e0acdfa7a8b2d50f384650a6c0 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -1173,7 +1173,7 @@ static int inv_mpu6050_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct inv_mpu6050_state *st = iio_priv(indio_dev); diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c index 2af772775b68932db45f2b9a5d40dc8b1bb247b5..324c38764656ad74e2bbdc54824b4321db3c0b81 100644 --- a/drivers/iio/imu/kmx61.c +++ b/drivers/iio/imu/kmx61.c @@ -942,7 +942,7 @@ static int kmx61_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct kmx61_data *data = kmx61_get_data(indio_dev); int ret = 0; diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c index fb4c6c39ff2e157593f02513cc8e01cd7eea9bdf..caefa15e559b8808051ff1c7f82c3f36c947933c 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c @@ -1959,7 +1959,7 @@ static int st_lsm6dsx_write_event_config(struct iio_dev *iio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct st_lsm6dsx_sensor *sensor = iio_priv(iio_dev); struct st_lsm6dsx_hw *hw = sensor->hw; diff --git a/drivers/iio/light/adux1020.c b/drivers/iio/light/adux1020.c index 2e0170be077aef9aa194fab51afbb33aec02e513..a36cdad113f774ef8733eb1aaef0f87d5d2532f1 100644 --- a/drivers/iio/light/adux1020.c +++ b/drivers/iio/light/adux1020.c @@ -502,7 +502,8 @@ static int adux1020_write_raw(struct iio_dev *indio_dev, static int adux1020_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, + bool state) { struct adux1020_data *data = iio_priv(indio_dev); int ret, mask; diff --git a/drivers/iio/light/apds9300.c b/drivers/iio/light/apds9300.c index 11f2ab4ca261813aff04b8c25d4595a531fb43cb..95861b2a5b2d94011d894959289c5c4f06cc1efe 100644 --- a/drivers/iio/light/apds9300.c +++ b/drivers/iio/light/apds9300.c @@ -321,7 +321,7 @@ static int apds9300_read_interrupt_config(struct iio_dev *indio_dev, static int apds9300_write_interrupt_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct apds9300_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/light/apds9306.c b/drivers/iio/light/apds9306.c index 079e02be1005210ddd30b384ffa1ff7feeb098d7..8adc74040db2bddf93fbb773e3519abcc726b9a6 100644 --- a/drivers/iio/light/apds9306.c +++ b/drivers/iio/light/apds9306.c @@ -1071,7 +1071,7 @@ static int apds9306_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct apds9306_data *data = iio_priv(indio_dev); struct apds9306_regfields *rf = &data->rf; diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c index 3a56eaae5a68f2891d061871c7013f0b5447bb47..a7f0cc99f236685900f89fbc48de3be0e9a40704 100644 --- a/drivers/iio/light/apds9960.c +++ b/drivers/iio/light/apds9960.c @@ -757,7 +757,7 @@ static int apds9960_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct apds9960_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/light/bh1745.c b/drivers/iio/light/bh1745.c index fc6bf062d4f510886f909509d8115f0cf892f3c4..23e9f16090ccdbb672fea741f3f4e361086f0360 100644 --- a/drivers/iio/light/bh1745.c +++ b/drivers/iio/light/bh1745.c @@ -638,7 +638,7 @@ static int bh1745_read_event_config(struct iio_dev *indio_dev, static int bh1745_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct bh1745_data *data = iio_priv(indio_dev); int value; diff --git a/drivers/iio/light/cm36651.c b/drivers/iio/light/cm36651.c index a4a1505534c015e3146c00de3e38966ffd712a5b..ae3fc3299eec6c30149bbfcb638d5c0001c30ed9 100644 --- a/drivers/iio/light/cm36651.c +++ b/drivers/iio/light/cm36651.c @@ -529,7 +529,7 @@ static int cm36651_write_prox_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct cm36651_data *cm36651 = iio_priv(indio_dev); int cmd, ret; diff --git a/drivers/iio/light/gp2ap002.c b/drivers/iio/light/gp2ap002.c index f8b1d7dd6f5fc69da12cf37ad286112555e4919f..d56ee217fe538c8babb5df510932bd6e67c59ea6 100644 --- a/drivers/iio/light/gp2ap002.c +++ b/drivers/iio/light/gp2ap002.c @@ -340,7 +340,7 @@ static int gp2ap002_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct gp2ap002 *gp2ap002 = iio_priv(indio_dev); diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index 81e718cdeae32d60581cb490148f4f1c0bd695c7..1a352c88598e5d701256aa8659a7f9683bce56f9 100644 --- a/drivers/iio/light/gp2ap020a00f.c +++ b/drivers/iio/light/gp2ap020a00f.c @@ -1159,7 +1159,7 @@ static int gp2ap020a00f_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct gp2ap020a00f_data *data = iio_priv(indio_dev); enum gp2ap020a00f_cmd cmd; diff --git a/drivers/iio/light/iqs621-als.c b/drivers/iio/light/iqs621-als.c index 6de33feada3a36f0656e9bdf5289560a49358b5a..b9f230210f0731b82139191366f2309f835c0b6d 100644 --- a/drivers/iio/light/iqs621-als.c +++ b/drivers/iio/light/iqs621-als.c @@ -271,7 +271,7 @@ static int iqs621_als_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct iqs621_als_private *iqs621_als = iio_priv(indio_dev); struct iqs62x_core *iqs62x = iqs621_als->iqs62x; diff --git a/drivers/iio/light/ltr390.c b/drivers/iio/light/ltr390.c index ff6b5d8b582b33eba60b769dff529caa00fb7244..b67c811cdf54af8de3dec3e1713a41312fb238d4 100644 --- a/drivers/iio/light/ltr390.c +++ b/drivers/iio/light/ltr390.c @@ -553,7 +553,7 @@ static int ltr390_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct ltr390_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 42daebd6023456098dc4bcedc3fe3a45f9ae5be0..cf01686dd92cd13f73b6abb14d4bb53dc1a28d0a 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1078,7 +1078,7 @@ static int ltr501_read_event_config(struct iio_dev *indio_dev, static int ltr501_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct ltr501_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/light/max44009.c b/drivers/iio/light/max44009.c index 3b92362675dc96fd37272bb5c25c20717b8c25b0..8cd7f5664e5b1a13aceb3aaeac3f6eef14a1eaac 100644 --- a/drivers/iio/light/max44009.c +++ b/drivers/iio/light/max44009.c @@ -422,7 +422,7 @@ static int max44009_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct max44009_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c index ff7fc0d4b08f9905bd6514d5f1c64b5923ec86cb..65b295877b41588d40234ca7681bfee291e937c2 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -634,7 +634,7 @@ static int opt3001_read_event_config(struct iio_dev *iio, static int opt3001_write_event_config(struct iio_dev *iio, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct opt3001 *opt = iio_priv(iio); int ret; diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index c6f950af5afa0f77a617bd2baf0a08eef5ec26f0..b81cc44db43c377ad8a8cc61c4430decb187181d 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -324,7 +324,7 @@ static int stk3310_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { int ret; struct stk3310_data *data = iio_priv(indio_dev); diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index 04452b4664f306339db42657c03e08bfc0ffff11..4186aac04902e6b12ee7978ef19c3b47faf773f7 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c @@ -327,7 +327,7 @@ static int tcs3472_read_event_config(struct iio_dev *indio_dev, static int tcs3472_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct tcs3472_data *data = iio_priv(indio_dev); int ret = 0; diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c index 1a6f514bced6e0bd542c14a279071d5820a462c8..f1fe7640fce63bddad57fbe7809ee60bbfd44e1f 100644 --- a/drivers/iio/light/tsl2563.c +++ b/drivers/iio/light/tsl2563.c @@ -630,7 +630,7 @@ static irqreturn_t tsl2563_event_handler(int irq, void *private) static int tsl2563_write_interrupt_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct tsl2563_chip *chip = iio_priv(indio_dev); int ret = 0; diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c index 850c2465992fa0d83430236825ce94051a104272..b81ca6f73f92732dc66a9be35c9dbed5088e8da1 100644 --- a/drivers/iio/light/tsl2591.c +++ b/drivers/iio/light/tsl2591.c @@ -985,7 +985,7 @@ static int tsl2591_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct tsl2591_chip *chip = iio_priv(indio_dev); struct i2c_client *client = chip->client; diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c index cab468a82b616a23394977da1d8822d29d8941d3..13086048ee5ffae77c26db8cbd3cb7002e1a72e2 100644 --- a/drivers/iio/light/tsl2772.c +++ b/drivers/iio/light/tsl2772.c @@ -1081,7 +1081,7 @@ static int tsl2772_write_interrupt_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int val) + bool val) { struct tsl2772_chip *chip = iio_priv(indio_dev); diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c index de6967ac3b0b3be02a96f3eb05aa58c49b0c87c7..c83114aed6b23f1d68068105b7c145bedf005b36 100644 --- a/drivers/iio/light/us5182d.c +++ b/drivers/iio/light/us5182d.c @@ -627,7 +627,7 @@ static int us5182d_read_event_config(struct iio_dev *indio_dev, static int us5182d_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct us5182d_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index 4e3641ff2ed446262c12380e520d3d220865c00c..e19199b17f2ef7ebd022c211605418711b8220d2 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -1456,7 +1456,7 @@ static int vcnl4010_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { switch (chan->type) { case IIO_PROXIMITY: @@ -1501,7 +1501,8 @@ static int vcnl4040_read_event_config(struct iio_dev *indio_dev, static int vcnl4040_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, + bool state) { int ret = -EINVAL; u16 val, mask; diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c index 95751c1015909cd80543a559673f435d1a168f68..208a040ee345c3e137e4e58c397c59ce4d68aa30 100644 --- a/drivers/iio/light/veml6030.c +++ b/drivers/iio/light/veml6030.c @@ -821,7 +821,7 @@ static int veml6030_read_interrupt_config(struct iio_dev *indio_dev, */ static int veml6030_write_interrupt_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { int ret; struct veml6030_data *data = iio_priv(indio_dev); diff --git a/drivers/iio/position/iqs624-pos.c b/drivers/iio/position/iqs624-pos.c index 4d7452314209fedd2e41e52764c6d036535cbbb1..8239239c6ee272f7dd6c4a615a29dd7f28d4be51 100644 --- a/drivers/iio/position/iqs624-pos.c +++ b/drivers/iio/position/iqs624-pos.c @@ -181,7 +181,7 @@ static int iqs624_pos_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct iqs624_pos_private *iqs624_pos = iio_priv(indio_dev); struct iqs62x_core *iqs62x = iqs624_pos->iqs62x; diff --git a/drivers/iio/proximity/aw96103.c b/drivers/iio/proximity/aw96103.c index 707ba0a510aa5f2a30d3fa70ae81fa58b8dfbc33..cdd254da9e5035e3c3e062fe27982b4108cc6a45 100644 --- a/drivers/iio/proximity/aw96103.c +++ b/drivers/iio/proximity/aw96103.c @@ -422,7 +422,7 @@ static int aw96103_read_event_config(struct iio_dev *indio_dev, static int aw96103_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct aw96103 *aw96103 = iio_priv(indio_dev); diff --git a/drivers/iio/proximity/cros_ec_mkbp_proximity.c b/drivers/iio/proximity/cros_ec_mkbp_proximity.c index b1a4a923e788949b583eca68ebd878e33e385f16..667369be05553ea668bfcd79695645dbf1e56a25 100644 --- a/drivers/iio/proximity/cros_ec_mkbp_proximity.c +++ b/drivers/iio/proximity/cros_ec_mkbp_proximity.c @@ -167,7 +167,7 @@ static int cros_ec_mkbp_proximity_read_event_config(struct iio_dev *indio_dev, static int cros_ec_mkbp_proximity_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct cros_ec_mkbp_proximity_data *data = iio_priv(indio_dev); diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c index d8fb34060d3db88a3ba5ecdc209b14be8e42e8b9..8c2f1cf062033dd8580f8f75649543289fbf9fb7 100644 --- a/drivers/iio/proximity/hx9023s.c +++ b/drivers/iio/proximity/hx9023s.c @@ -874,7 +874,7 @@ static int hx9023s_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct hx9023s_data *data = iio_priv(indio_dev); diff --git a/drivers/iio/proximity/irsd200.c b/drivers/iio/proximity/irsd200.c index 6e96b764fed8b577d71c3146210679b0b61d4c38..eded45a778737a699f8b69ad86a9909594e04b32 100644 --- a/drivers/iio/proximity/irsd200.c +++ b/drivers/iio/proximity/irsd200.c @@ -648,7 +648,8 @@ static int irsd200_read_event_config(struct iio_dev *indio_dev, static int irsd200_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, + bool state) { struct irsd200_data *data = iio_priv(indio_dev); unsigned int tmp; diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index 3f4eace05cfc6a4679fe82854dc059aa4a710d6d..e7da02c59b753158c30c7473bdeea8886a2977a3 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -540,7 +540,7 @@ static int sx9500_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct sx9500_data *data = iio_priv(indio_dev); int ret; diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c index bcf502e0234236e2362c1eb63da3bc488b0178a1..76384c74fe0120e9d004ecad28b4339793edb414 100644 --- a/drivers/iio/proximity/sx_common.c +++ b/drivers/iio/proximity/sx_common.c @@ -268,7 +268,7 @@ EXPORT_SYMBOL_NS_GPL(sx_common_read_event_config, SEMTECH_PROX); int sx_common_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct sx_common_data *data = iio_priv(indio_dev); unsigned int eventirq = SX_COMMON_FAR_IRQ | SX_COMMON_CLOSE_IRQ; diff --git a/drivers/iio/proximity/sx_common.h b/drivers/iio/proximity/sx_common.h index da53268201a9fcdec9469fb5798d049146b08329..fb14e6f06a6de3485e0b817e4a069d5300ddfb6c 100644 --- a/drivers/iio/proximity/sx_common.h +++ b/drivers/iio/proximity/sx_common.h @@ -143,7 +143,7 @@ int sx_common_read_event_config(struct iio_dev *indio_dev, int sx_common_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state); + enum iio_event_direction dir, bool state); int sx_common_probe(struct i2c_client *client, const struct sx_common_chip_info *chip_info, diff --git a/drivers/iio/proximity/vcnl3020.c b/drivers/iio/proximity/vcnl3020.c index d1ddf85f53836ec34464d382426b187804964a57..bb6c9cc88b358de098543df8a0da7d22914c5e47 100644 --- a/drivers/iio/proximity/vcnl3020.c +++ b/drivers/iio/proximity/vcnl3020.c @@ -449,7 +449,7 @@ static int vcnl3020_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { switch (chan->type) { case IIO_PROXIMITY: diff --git a/drivers/iio/temperature/mcp9600.c b/drivers/iio/temperature/mcp9600.c index f1bb0976273d37fd662ed4e7e3f43c9ae82e2aaf..c2447860adfd6f4b1a9f4d61e3de301271fe05d9 100644 --- a/drivers/iio/temperature/mcp9600.c +++ b/drivers/iio/temperature/mcp9600.c @@ -200,7 +200,7 @@ static int mcp9600_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state) + bool state) { struct mcp9600_data *data = iio_priv(indio_dev); struct i2c_client *client = data->client; diff --git a/drivers/iio/temperature/tmp007.c b/drivers/iio/temperature/tmp007.c index 9bdfa94234929c35f3e4871bc291be21bbfba82e..fd4d389ce1dfec031652d4f7881ec0b72a015998 100644 --- a/drivers/iio/temperature/tmp007.c +++ b/drivers/iio/temperature/tmp007.c @@ -216,7 +216,7 @@ static irqreturn_t tmp007_interrupt_handler(int irq, void *private) static int tmp007_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, - enum iio_event_direction dir, int state) + enum iio_event_direction dir, bool state) { struct tmp007_data *data = iio_priv(indio_dev); unsigned int status_mask; diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 3a9b57187a958d6e65c699cf7814df5bac9a99e3..6a07cd6820b6d95493d7ad78981ba1ad19446768 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -514,7 +514,7 @@ struct iio_info { const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - int state); + bool state); int (*read_event_value)(struct iio_dev *indio_dev, const struct iio_chan_spec *chan,