From nobody Mon Nov 25 03:57:42 2024 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4574E1A2C04 for ; Thu, 31 Oct 2024 15:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730388439; cv=none; b=bIT5qFlmvHnaT0MaclwdEpbxuPWGIOBTL0hDWkhyJ1nOuQwkrm07RdAwdxr/MUkfRZOBFo7aZANfsNfcAUDzRory/2zoHfc2Gj6PcKnU5e1I+FSlSjbsF4Yvlf8UvHVKUNGV8EV6cfEHaOdFSJnaY2heL7bzVzu4ajmiGqyVbfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730388439; c=relaxed/simple; bh=66ZxtddfwLUrZfVWDUy855V73GaqhvBsIS8BnX4bHQI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Fkh7daflTMlG1CK9SGtiHeQKYjpqH6ZLHVJxY80jTKwRXtBEseCE40y5rUx37bVWd2IchbHghVS0Lyh84XvEe00uf54YaXA3l+1dv+tO/TBAnibAqxARv8CnEXU8EMmgmI/tB9sMc3lXfjHHsYd49PXhbuWT6Iwm41lCRT7I7TE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=eg+hRmOE; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="eg+hRmOE" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4316f3d3c21so8570365e9.3 for ; Thu, 31 Oct 2024 08:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730388436; x=1730993236; darn=vger.kernel.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=DGlZIwMvz6c7bRFXG/zclkCMmlIDWe/JH5j5KVgG3hQ=; b=eg+hRmOEr++M7P4bSWMJLSoog3cNkBJQDvDjKXsHFmpkNixAVvkpFSWY9rgybiegJr nqnhvmTE/FuWEkFcgUqJUc+k6NihJu7dsW1AkocrpSaGqU2p08caWQ2tzedFCynQHt3F Pi+hPs59TD1n/NjIIMCT7bEqibiHNuFQLE5dT15YVlv3kR/pCHq7sNxXtSCgI/59n0Xk fqoQd2eKYiCnMOsrUmv70JTKe11HKHURLSdLce7ReYe5nBpeP4eiLzTYBD4Xwyj6AqNs B2I2xCl5JBTrQ6zlSuFpjlKJKN/7Qor3UodXKvRVEGcSqskklUZibofX3zOUezvc98WI nV+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730388436; x=1730993236; 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=DGlZIwMvz6c7bRFXG/zclkCMmlIDWe/JH5j5KVgG3hQ=; b=jcsdCf4FrQkN3zedu+lbP70FGG1hQZlloHNHZE4PTTM67v953PuMmAs2cp0+bUHiRy w301Ih6J+ElOrLpJo16qJGUwtyeC2oKXec+91LvUz/KvPRBNoyMgVYrpN1dybXaNgUlh 9wKS9Z6hCbiVrcGZJ5wSQ0yRTQmpQap6SYm59Vrar8//XWUrwWh5SK/KjoU9UN1VmQQq Ty/rGbaEw6RmiABS2mTzustPWSjk4Xa39KJ46OZuwOMjLdgcas2YW4vZi4gyOuoRdMUo 8oU9a4qUxX2uUtm74D5+gFDdtsPUOA/B0Y90qhHXpnMTJAAywyblQY2nao9RTl7M8TMd SILA== X-Forwarded-Encrypted: i=1; AJvYcCXJzM99QawKa+aX5ssy6gngNb9bZVbiT4SBxFifDZ4meJtn3GHiJlwdpvLxiem3WHs/2TQ9aQRjw4AaPuc=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0sNSOOfR/844qfTrLnedI+HmfuohgIwJshP7lQ3/fngagVxTy IPLLyb3pcK2vbX13SCoa4ctw3urQDNdDyzi3TewwS381OuT/F1zhTEyzz2pqkKo= X-Google-Smtp-Source: AGHT+IHlxC61R96I9SqIUQT7uQ6GYz6mwcgP7vSir2EsAglaq5XnaVblxKW0wQCsPc9q6MdamJ1CIQ== X-Received: by 2002:a05:600c:458f:b0:431:5ed4:7e7d with SMTP id 5b1f17b1804b1-4327a82f755mr47859695e9.18.1730388435648; Thu, 31 Oct 2024 08:27:15 -0700 (PDT) Received: from [192.168.1.64] (2a02-8428-e55b-1101-1e41-304e-170b-482f.rev.sfr.net. [2a02:8428:e55b:1101:1e41:304e:170b:482f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d5bf429sm29399475e9.12.2024.10.31.08.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:27:15 -0700 (PDT) From: Julien Stephan Date: Thu, 31 Oct 2024 16:27:03 +0100 Subject: [PATCH v2 08/15] iio: accel: mma9551: use bool for event state Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241031-iio-fix-write-event-config-signature-v2-8-2bcacbb517a2@baylibre.com> References: <20241031-iio-fix-write-event-config-signature-v2-0-2bcacbb517a2@baylibre.com> In-Reply-To: <20241031-iio-fix-write-event-config-signature-v2-0-2bcacbb517a2@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 Since the write_event_config callback now uses a bool for the state parameter, update the signature of the function it calls accordingly, and use a bool array for event_enabled. Signed-off-by: Julien Stephan --- drivers/iio/accel/mma9551.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c index 605022f5239a6412827f4ba059aa18d490908720..6d73eec951263956f314f82542b= ecbbae933de91 100644 --- a/drivers/iio/accel/mma9551.c +++ b/drivers/iio/accel/mma9551.c @@ -45,7 +45,7 @@ enum mma9551_tilt_axis { struct mma9551_data { struct i2c_client *client; struct mutex mutex; - int event_enabled[3]; + bool event_enabled[3]; int irqs[MMA9551_GPIO_COUNT]; }; =20 @@ -162,7 +162,7 @@ static int mma9551_read_event_config(struct iio_dev *in= dio_dev, =20 static int mma9551_config_incli_event(struct iio_dev *indio_dev, enum iio_modifier axis, - int state) + bool state) { struct mma9551_data *data =3D iio_priv(indio_dev); enum mma9551_tilt_axis mma_axis; @@ -174,7 +174,7 @@ static int mma9551_config_incli_event(struct iio_dev *i= ndio_dev, if (data->event_enabled[mma_axis] =3D=3D state) return 0; =20 - if (state =3D=3D 0) { + if (!state) { ret =3D mma9551_gpio_config(data->client, (enum mma9551_gpio_pin)mma_axis, MMA9551_APPID_NONE, 0, 0); --=20 2.47.0