From nobody Wed Jun 17 05:10:18 2026 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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 305571FE451 for ; Wed, 22 Apr 2026 16:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877014; cv=none; b=etel4mACFTt1NhlqjpPpVi4dmY/s/zyIYuxjfazJ/69eeqIbQonBCxCfE9jEmgcgTSUmYZmnurPjsGp1C7h2S19LqB1jD9tC9KjgaUf8w6RH346w0luGHX3DB9PSnKBbWTYtSvY0gOKwoFg6mnzqey9ww7CJ+mRbhcKuTcSSU/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877014; c=relaxed/simple; bh=2s6lMJnNRX7McdMR9xOP9NNAuG6c7NlV7IsKOLCquf4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Alx9H99++lUm8z+lotTdANphqMO93jNePFoNl62tR9ej6CjH6IlO6o464mDsdcmT9n/pp/jZZKOS2EtVNzfWvf/a2fo9sRxL4FyzGuNwHCkgU7qfJnukKVOpW/nvkmMUp5vvnv6ycXZnLEAAKGlyiX8tmSypmBMTKOTtgxavMqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fSIWEHJS; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fSIWEHJS" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-c797d5ad36bso1730881a12.2 for ; Wed, 22 Apr 2026 09:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776877012; x=1777481812; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=drrRiklWz/CIT2ToxtXvHdj2HR+FSt7bFEX7xEGwwQE=; b=fSIWEHJSKv89u+Dq/+OQHbV6GFPHl1R27X5UoH0gxBy/R0PB5BFVgZOWcr9v5GbY4z eAzWIAstCjglhpu2raYqewPVmTgIjiKYDCc39HNB2VYiyC9EjlK3pqRqPO1sU4kIAVLx zcFNWfHOqNg7DVAmgd/v+NEGNPknqGZfYbJ+9Q0K7+LmEC1f9oJFeoh01+V4EhRgtLA5 kZsqMbPP1Y5TvM8iVb4hMYTopW/97/bzqII10sb4sRhstSnqC/X1tBe9Q12ylxv+9Twd vBR2G/25VeU3FksKhl3/t1SXDFSOc2WC6hjtRZWssMYBsS2N/W/Qa/P4Va8QU03n7uDR E3xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776877012; x=1777481812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=drrRiklWz/CIT2ToxtXvHdj2HR+FSt7bFEX7xEGwwQE=; b=hTybOzh1dfyT8Em17IDl0kKrZRJCpGGTk71CR8qVTWOvw9kIj9SiPM8j/obT1udfP5 5tMSjSyCY3y6uAfepH/BMWCH++Y8xH+gUncYODdcpSxJlFhVxzIs986H77U0cGo2JbyF hUfxNFZESZxK965HesdCZ4J2LOQn7CGAzH719UDcSzbymFx9C5nJHcpIQTIOKXt+4sge nfH/4RV7xL1Fh+4fMTcPVo3SFmrsteKT+eJCucMytpC66NXjIUIVMhqtbX30PCyCNGdZ 7yyv97PpImCRfAehk9GMXgpEKWv8Uj/fz6AL/7bDj1J0ey81mJh3IwLuXmzKYCsw1a5E PpSA== X-Forwarded-Encrypted: i=1; AFNElJ99y58nXdXHzqu4at5ESAMDwkYt1YYERyG7vh0IcVTm1vZoNmRxCaBgnkxwwhowLnkjMDKsWP/xBVyEKTg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0EqEi68yJM9KMD3ZLCr2gtk3SctRuohiqxzLaH/fIRjjDPkq7 CxOz8El1G99tgZEcLr0NAIZybimVOv5IxHCCQyvQ12nUh+m3oLRF+dvt X-Gm-Gg: AeBDiescYvL54IkbhbXnkQhogWxXNpnznkSg0d3ps8aoN94af4J3SmiXJfR9sfkHoPr ANJObhaSssSyLxeKtoreR0cAXj0ZgUKl6LPvGBCDuYAwoEbGs0usTPAGwfDEsqqeFW+HAM/mf+d jbPBglfaMEdqOCRkSgdvjXnfZiU8ihKZNYKhuz22X49pfEuiF6OV9yrdDduev8fbw4GbHUMBt6G yiQHjJ4Dto+C+gQWMNXmiTqZjNg5d72CBOJ5dWndT96RAb2bfmwuw518WksMmbdvzKc0ep/woDn pZQ06xEsf2dAqu3nTyJPiEYLi+35phRZQtAetAlkjrZ9HdY47lVrag/8LSLqit8M2EpFrTmcC2a VrurmemFg+7aO68jdm4pk0mwYGnTzLtQg4AlGLpPL8rFc9V4OXmZQgRElTt2gZm6KY9lIDErbcA ccFyGE99PKbtDQY9BZMcGGIL68mqQI9KEVc+6m9ibAk2ly9o9POpaVkeo1jts= X-Received: by 2002:a05:6a20:7285:b0:39f:27ab:2454 with SMTP id adf61e73a8af0-3a08d90d557mr26185501637.49.1776877012485; Wed, 22 Apr 2026 09:56:52 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976fa3604sm11908675a12.14.2026.04.22.09.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 09:56:52 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] iio: accel: mma8452: cleanup codestyle warning Date: Wed, 22 Apr 2026 22:26:38 +0530 Message-Id: <20260422165643.2148195-2-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260422165643.2148195-1-sanjayembedded@gmail.com> References: <20260422165643.2148195-1-sanjayembedded@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sanjay Chitroda Reported by checkpatch: FILE: drivers/iio/accel/mma8452.c CHECK: Alignment should match open parenthesis Signed-off-by: Sanjay Chitroda --- drivers/iio/accel/mma8452.c | 47 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 15172ba2972c..6d9091f696cf 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -704,8 +704,8 @@ static int mma8452_set_hp_filter_frequency(struct mma84= 52_data *data, } =20 static int __mma8452_write_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - int val, int val2, long mask) + struct iio_chan_spec const *chan, + int val, int val2, long mask) { struct mma8452_data *data =3D iio_priv(indio_dev); int i, j, ret; @@ -786,8 +786,9 @@ static int mma8452_write_raw(struct iio_dev *indio_dev, } =20 static int mma8452_get_event_regs(struct mma8452_data *data, - const struct iio_chan_spec *chan, enum iio_event_direction dir, - const struct mma8452_event_regs **ev_reg) + const struct iio_chan_spec *chan, + enum iio_event_direction dir, + const struct mma8452_event_regs **ev_reg) { if (!chan) return -EINVAL; @@ -816,11 +817,11 @@ static int mma8452_get_event_regs(struct mma8452_data= *data, } =20 static int mma8452_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, - int *val, int *val2) + const struct iio_chan_spec *chan, + enum iio_event_type type, + enum iio_event_direction dir, + enum iio_event_info info, + int *val, int *val2) { struct mma8452_data *data =3D iio_priv(indio_dev); int ret, us, power_mode; @@ -879,11 +880,11 @@ static int mma8452_read_event_value(struct iio_dev *i= ndio_dev, } =20 static int mma8452_write_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, - int val, int val2) + const struct iio_chan_spec *chan, + enum iio_event_type type, + enum iio_event_direction dir, + enum iio_event_info info, + int val, int val2) { struct mma8452_data *data =3D iio_priv(indio_dev); int ret, reg, steps; @@ -953,8 +954,7 @@ static int mma8452_read_event_config(struct iio_dev *in= dio_dev, case IIO_EV_DIR_FALLING: return mma8452_freefall_mode_enabled(data); case IIO_EV_DIR_RISING: - ret =3D i2c_smbus_read_byte_data(data->client, - ev_regs->ev_cfg); + ret =3D i2c_smbus_read_byte_data(data->client, ev_regs->ev_cfg); if (ret < 0) return ret; =20 @@ -1191,7 +1191,7 @@ static const struct attribute_group mma8452_event_att= ribute_group =3D { =20 static const struct iio_mount_matrix * mma8452_get_mount_matrix(const struct iio_dev *indio_dev, - const struct iio_chan_spec *chan) + const struct iio_chan_spec *chan) { struct mma8452_data *data =3D iio_priv(indio_dev); =20 @@ -1514,8 +1514,9 @@ static int mma8452_reset(struct i2c_client *client) * The following code will read the reset register, and check whether * this reset works. */ - i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2, - MMA8452_CTRL_REG2_RST); + i2c_smbus_write_byte_data(client, + MMA8452_CTRL_REG2, + MMA8452_CTRL_REG2_RST); =20 for (i =3D 0; i < 10; i++) { usleep_range(100, 200); @@ -1645,8 +1646,8 @@ static int mma8452_probe(struct i2c_client *client) dev_dbg(&client->dev, "using interrupt line INT2\n"); } else { ret =3D i2c_smbus_write_byte_data(client, - MMA8452_CTRL_REG5, - data->chip_info->all_events); + MMA8452_CTRL_REG5, + data->chip_info->all_events); if (ret < 0) goto disable_regulators; =20 @@ -1654,8 +1655,8 @@ static int mma8452_probe(struct i2c_client *client) } =20 ret =3D i2c_smbus_write_byte_data(client, - MMA8452_CTRL_REG4, - data->chip_info->enabled_events); + MMA8452_CTRL_REG4, + data->chip_info->enabled_events); if (ret < 0) goto disable_regulators; =20 --=20 2.34.1 From nobody Wed Jun 17 05:10:18 2026 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 6DECD386455 for ; Wed, 22 Apr 2026 16:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877017; cv=none; b=jizyMLTjuSpyepkiDVAwca8YpmLvdlsmT7EsUmaNxUpCwmwrid/FISj7P2X9skSSLEf2FmAfTrGtpkovS7NdeuaHtXld43LGJU1oszHeB94n0Il4Q01U+tLj3jovSR2D0atS8qmvKSt5R0hlSOYvf/6qaw5KMn6xqAn5PGecnFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877017; c=relaxed/simple; bh=MhJmoEAYvAq3zlu4mLX96ThWtNiAsD8w6ypo3RKq594=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P+3+a82vOdsimhGXFHksvwuDfPlmSrS5IeL8ldlLldNr5RaqzPXFHQELBRAPkHL0h2vCjZEENUB7CfA2UCtcyKHcv20Z8e0RvTfuK2YtToU7sjCqCxwbIv0cR0DDrugGdqIONBKNXtPUsnmYpnGSL5GDzkb7Ct8xtOxexrAwmfQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bV5Q9uT0; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bV5Q9uT0" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c70f91776fcso2251043a12.0 for ; Wed, 22 Apr 2026 09:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776877016; x=1777481816; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zuuPXKx9fNOIPTaVS+7TepVaEnB9XvGzk7sNSjhVUGQ=; b=bV5Q9uT0B955L9D4MwC/4sPupIjFuvZlyEUjQaT7Jedmc8n/4CTP+3PYSSJC2gM4b8 9sfHx1y1Sx7njKFNdLYiLBViIXOIr0fCLOcfGk5MykuXKEiyuClP+NM/54scGMn+6cnW TYKOW+6G0yLFFBPKbmafqJD9JMFtXIHryCxLmmpV5WCgILaolbnJfflZW6ujsvXny4VU ofk3qFrTbWDA3yRb+KqsJEyzqk5tbxeboZPD88MlUCQAFqC49la1vr8VoeZTo7gLg1Ra pMP9CjusZK0YrGNXdiwn9ah4k0nGZ5rTGjemUCGp39ntqjSLWm2YXdhkQq2ekKnCTqL4 RKkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776877016; x=1777481816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zuuPXKx9fNOIPTaVS+7TepVaEnB9XvGzk7sNSjhVUGQ=; b=ZNnuoXG5vdyHr9t7qZshotVv3ye71esV5UYi5vJdVhPh+juQA7HFJaf5LpF6GUAnXl Cl1N00C5iDRctEOoIy2TqVnHtacJXuK5XTrbv6Xbnj388cJswASxwq/Grlvvfu5aPaNd gsy/I4J8b6Sb/jZ84MFEnlWUhZpYrmqWWEopSHjfVtWHIhpaDbZUvcghjgeDNNnKCXzb BO0dZtmuecglkhwe6hKNK5OUUFTFow3rGhK37rPhmHCMcuEhqjBJJSnmnj9MqT5cnIFd DpkLOFcohsbI4bk6dZlwDLui0BLJxgq1f5tLwCZF6KNf9E2z+8eWsHENCX8ztDrulMyc bIug== X-Forwarded-Encrypted: i=1; AFNElJ8NDg2RBJrgu3uACGVOQV265zWZ1SltT2o2l4VtGPEgqBVdqaj3IEbZCvjc139HTUA5rP8312SarOOEWJY=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1lSmv4WUueJuCZxDY/KkoNTHpwSCi0RuXmJHgE4j0HrLNbwJo vPZT6U2Kuh/rLkWIAo9FJucWgH7fDCP4j0WxmXRx2F0be+16ZbsgyaTv X-Gm-Gg: AeBDievL3y6bHpTxpRRt/W+iJdmFXpi3R4JWy2AD/iuO1FcIbWuj1V8Q6iWOsXdOw/Z mykyEwJlZ3QC4Ts7tBdVtTS4OoSubN2NWi1U2EWGkFhEfWNOXttfsNF61q2vfnNV/E3CYd8UFhZ k/nbx0hU7r8WzYyjYgy89DxIOt1nVcrlFzcI2xnx9gxB+2Kr8Q8O12eCOu0yABvwPoV7lUM7vcD 0Fg8p7OHQ3ViqISAN2MnpB+TmWp10nvVurIwUhuzWhHpyN+PX78bwtHZjoG7y3CAniUBisQCvhv AsF5hAaZXSIe5N2eBYYKbdiVPapA80aMg0ApAKKSrvcG36wNZHgz8BTYKFFEg7uWhzkZeyE7ZnZ wv9OpSDLYbpTe+NNvb0lwloaQWu3kt078et8ieyB9sadAgX2s2eoDkFTaesvFuqpf8jL7LF1SJF mUSn0kdTsmkFOnYRsHrBBsxPM73IQRYITB/mRjVUhk5brV9rf6AAfT3N+4ED4= X-Received: by 2002:a05:6a21:1644:b0:39b:f25a:28d7 with SMTP id adf61e73a8af0-3a08d687945mr26426153637.3.1776877015685; Wed, 22 Apr 2026 09:56:55 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976fa3604sm11908675a12.14.2026.04.22.09.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 09:56:55 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/6] iio: accel: mma8452: sort headers alphabetically Date: Wed, 22 Apr 2026 22:26:39 +0530 Message-Id: <20260422165643.2148195-3-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260422165643.2148195-1-sanjayembedded@gmail.com> References: <20260422165643.2148195-1-sanjayembedded@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sanjay Chitroda Sort include headers alphabetically to improve readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/accel/mma8452.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 6d9091f696cf..c54c0ea05ac1 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -18,21 +18,23 @@ * TODO: orientation events */ =20 -#include +#include +#include #include +#include +#include #include -#include +#include + +#include +#include #include #include -#include #include #include #include -#include -#include -#include + #include -#include =20 #define MMA8452_STATUS 0x00 #define MMA8452_STATUS_DRDY (BIT(2) | BIT(1) | BIT(0)) --=20 2.34.1 From nobody Wed Jun 17 05:10:18 2026 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 83BEA33C502 for ; Wed, 22 Apr 2026 16:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877021; cv=none; b=Bq1WKFte+agoa9fsX6BFIRpih9rIDP5aQSaRKfqBA39wxHw3dy6lM9i0PpMMd368hMZMewNCv+LOKRipl2v2YVgOWb02XzJ7yD+ENzblnyn3Y1FDhYobhx8klriN/LoOgTApgdJoWVbuGtt8TvPI7y7uaoz6+j8lgseYfBKQ7bU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877021; c=relaxed/simple; bh=/DEF03+Ny2zofE3o7sXb1vSvhn7QhkSEjmX8qFoy/Q0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g3Xa+NjqGiEm4gmCxPR3zWB+k7VFmm9mGWf9wV4hxIjJ8IJS8NmEypMyjlPymUNQwXVOap6PkBucBis+Epr9eVaejjEpQYMz7YvJqlBa8J1BXVEG+PATivLUJyBHkXCcnEByxyzI92ghZBtciVFT7S/hYiXi/x2wkpTxsLk2ULo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LSpm5I+n; arc=none smtp.client-ip=209.85.215.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LSpm5I+n" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-c79506f3c40so2103479a12.1 for ; Wed, 22 Apr 2026 09:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776877019; x=1777481819; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zo6cBzpo0BEVINRfHFaDDZPqy/3hvitzq+I6vTy8fqs=; b=LSpm5I+nWUkLLeQ2iOujt6YK7DErP6Edqwn8S66oLrJMYFflx/Sr6lXOLX3zz8JJHI 8yYzZB4Uqoux5rKoO3l9ivGL8mL8wcLshJcpgmjrTnGTHwfeS089aNtFS/BkFZVuKN8c yvONtCawh5A+1AWb+Mb98R6c2umZr7THEJJziabPCk5OxBFH5kBH5ZZnqVbIp+4/ozYu cetJiDHV75ShRFzbx6DxXkzPNaHTa3Yl02KSEUuKzpJFO143AExZ504epXQ+/WMDGdxj yduf2Bg8r4PRcSZoQJzwuGF5ofWaj7n8mmJbhvG8OXKu+lHIIa93mmAVzfff8aRm6HSU /p4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776877019; x=1777481819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Zo6cBzpo0BEVINRfHFaDDZPqy/3hvitzq+I6vTy8fqs=; b=R+BfM7bgmrC74YCKKuDEQggNcUeGdmSV2pUl39M1N4em136I86nDxztk0RF46MnPJ+ lFGTI844U+r1JspzBSjxvovebLYTLmQ3Soop27/8qkYWDPMOhRbIJGANmY0TO26dnBqw zvK2d9xauLzAfBUtb56LBMZS7BCtSEpTv4P7BvWRQ/oxNjFkdLzQoqrWMRhmvfYGQAmK IX09+CKszaPTBXp1MV6Xkcslax2DYlFnvjJd36ezSAhpZSgyGRDBQj2T1lIbtBENGGa6 QnZJ5u2xL/5Sax9N9YNttpxET+YkATeZsavQXZje7gt/TxOnvn04s+UI91UFDFfIWiC4 J9fA== X-Forwarded-Encrypted: i=1; AFNElJ8qBKD9XgyKQOylhO4ha7Ozd2HBCTpnlAvpAqHipzQ8wNMlCE3X3Hur4NCKN93/1iIVpPNrGT6zdaW4kqk=@vger.kernel.org X-Gm-Message-State: AOJu0YweEfnbIiPLbiaPLrQFY0YqEEZzxNqAe57rFefYtjY+diu3VY0h OZ6AN2ii4h5miyGDyr19mHk+NTTL5IEFdeBa9Nw0muLeTvvxsRFW9783 X-Gm-Gg: AeBDiet7eNvjflGzDS6jm5kqqgHbocRRasGROuevfXbriqkBQyRItyjRZRxTFmtVo/Z kDGH4XD+hQzojLv7CsT0dJ375itITXq7t3YBT8D5im/mFEyEV1MRRO/3I7b96kyDtV0S0nuxXGp QowCKwK4PzTKT1trLsOtGXMLwl449laHxBzkCSoPhp3sIafU23mPW3V0AGRdiV7f9QuefAECP/P bB3wgb5uVBQdhrSo7iKaC78AHhFq8NilwtpCZoNZSw3shjWNS9DdP2cuhAorwuYyqjXQ/6dFmCX idJ3U2X3GzsUV5IWKE3l6UaJooSG/HnPPSINblsWP7JznUNini0vaRFTurlk2LUOeLoCjb2ra1P JA5s8z8w6SwBhojyZQwk/79BiMJf69BO2NrqbA3nnprrDytBg6UHXEaN6nIYEGospbybQgy3rQT Hqv4ILfzr9TPvhldPykEygdkz4/bEdH1uzBgJnOf9Rm3B6EHvq/IsD/lqQXV0= X-Received: by 2002:a05:6a20:4313:b0:398:9379:d04d with SMTP id adf61e73a8af0-3a08d7874a6mr25472562637.24.1776877018924; Wed, 22 Apr 2026 09:56:58 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976fa3604sm11908675a12.14.2026.04.22.09.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 09:56:58 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] iio: accel: mma8452: use local struct device Date: Wed, 22 Apr 2026 22:26:40 +0530 Message-Id: <20260422165643.2148195-4-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260422165643.2148195-1-sanjayembedded@gmail.com> References: <20260422165643.2148195-1-sanjayembedded@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sanjay Chitroda Introduce a local struct device pointer derived from &client->dev. This avoids repeated &client->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/accel/mma8452.c | 51 ++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index c54c0ea05ac1..99f7763b84ac 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -225,13 +225,14 @@ static int mma8452_set_runtime_pm_state(struct i2c_cl= ient *client, bool on) { #ifdef CONFIG_PM int ret; + struct device *dev =3D &client->dev; =20 if (on) - ret =3D pm_runtime_resume_and_get(&client->dev); + ret =3D pm_runtime_resume_and_get(dev); else - ret =3D pm_runtime_put_autosuspend(&client->dev); + ret =3D pm_runtime_put_autosuspend(dev); if (ret < 0) { - dev_err(&client->dev, + dev_err(dev, "failed to change power state to %d\n", on); =20 return ret; @@ -1548,10 +1549,11 @@ MODULE_DEVICE_TABLE(of, mma8452_dt_ids); static int mma8452_probe(struct i2c_client *client) { struct mma8452_data *data; + struct device *dev =3D &client->dev; struct iio_dev *indio_dev; int ret; =20 - indio_dev =3D devm_iio_device_alloc(&client->dev, sizeof(*data)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*data)); if (!indio_dev) return -ENOMEM; =20 @@ -1561,32 +1563,32 @@ static int mma8452_probe(struct i2c_client *client) =20 data->chip_info =3D i2c_get_match_data(client); if (!data->chip_info) - return dev_err_probe(&client->dev, -ENODEV, + return dev_err_probe(dev, -ENODEV, "unknown device model\n"); =20 - ret =3D iio_read_mount_matrix(&client->dev, &data->orientation); + ret =3D iio_read_mount_matrix(dev, &data->orientation); if (ret) return ret; =20 - data->vdd_reg =3D devm_regulator_get(&client->dev, "vdd"); + data->vdd_reg =3D devm_regulator_get(dev, "vdd"); if (IS_ERR(data->vdd_reg)) - return dev_err_probe(&client->dev, PTR_ERR(data->vdd_reg), + return dev_err_probe(dev, PTR_ERR(data->vdd_reg), "failed to get VDD regulator!\n"); =20 - data->vddio_reg =3D devm_regulator_get(&client->dev, "vddio"); + data->vddio_reg =3D devm_regulator_get(dev, "vddio"); if (IS_ERR(data->vddio_reg)) - return dev_err_probe(&client->dev, PTR_ERR(data->vddio_reg), + return dev_err_probe(dev, PTR_ERR(data->vddio_reg), "failed to get VDDIO regulator!\n"); =20 ret =3D regulator_enable(data->vdd_reg); if (ret) { - dev_err(&client->dev, "failed to enable VDD regulator!\n"); + dev_err(dev, "failed to enable VDD regulator!\n"); return ret; } =20 ret =3D regulator_enable(data->vddio_reg); if (ret) { - dev_err(&client->dev, "failed to enable VDDIO regulator!\n"); + dev_err(dev, "failed to enable VDDIO regulator!\n"); goto disable_regulator_vdd; } =20 @@ -1609,7 +1611,7 @@ static int mma8452_probe(struct i2c_client *client) goto disable_regulators; } =20 - dev_info(&client->dev, "registering %s accelerometer; ID 0x%x\n", + dev_info(dev, "registering %s accelerometer; ID 0x%x\n", data->chip_info->name, data->chip_info->chip_id); =20 i2c_set_clientdata(client, indio_dev); @@ -1642,10 +1644,10 @@ static int mma8452_probe(struct i2c_client *client) if (client->irq) { int irq2; =20 - irq2 =3D fwnode_irq_get_byname(dev_fwnode(&client->dev), "INT2"); + irq2 =3D fwnode_irq_get_byname(dev_fwnode(dev), "INT2"); =20 if (irq2 =3D=3D client->irq) { - dev_dbg(&client->dev, "using interrupt line INT2\n"); + dev_dbg(dev, "using interrupt line INT2\n"); } else { ret =3D i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG5, @@ -1653,7 +1655,7 @@ static int mma8452_probe(struct i2c_client *client) if (ret < 0) goto disable_regulators; =20 - dev_dbg(&client->dev, "using interrupt line INT1\n"); + dev_dbg(dev, "using interrupt line INT1\n"); } =20 ret =3D i2c_smbus_write_byte_data(client, @@ -1683,7 +1685,7 @@ static int mma8452_probe(struct i2c_client *client) goto trigger_cleanup; =20 if (client->irq) { - ret =3D devm_request_threaded_irq(&client->dev, + ret =3D devm_request_threaded_irq(dev, client->irq, NULL, mma8452_interrupt, IRQF_TRIGGER_LOW | IRQF_ONESHOT, @@ -1692,14 +1694,14 @@ static int mma8452_probe(struct i2c_client *client) goto buffer_cleanup; } =20 - ret =3D pm_runtime_set_active(&client->dev); + ret =3D pm_runtime_set_active(dev); if (ret < 0) goto buffer_cleanup; =20 - pm_runtime_enable(&client->dev); - pm_runtime_set_autosuspend_delay(&client->dev, + pm_runtime_enable(dev); + pm_runtime_set_autosuspend_delay(dev, MMA8452_AUTO_SUSPEND_DELAY_MS); - pm_runtime_use_autosuspend(&client->dev); + pm_runtime_use_autosuspend(dev); =20 ret =3D iio_device_register(indio_dev); if (ret < 0) @@ -1732,12 +1734,13 @@ static int mma8452_probe(struct i2c_client *client) static void mma8452_remove(struct i2c_client *client) { struct iio_dev *indio_dev =3D i2c_get_clientdata(client); + struct device *dev =3D &client->dev; struct mma8452_data *data =3D iio_priv(indio_dev); =20 iio_device_unregister(indio_dev); =20 - pm_runtime_disable(&client->dev); - pm_runtime_set_suspended(&client->dev); + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); =20 iio_triggered_buffer_cleanup(indio_dev); mma8452_trigger_cleanup(indio_dev); @@ -1758,7 +1761,7 @@ static int mma8452_runtime_suspend(struct device *dev) ret =3D mma8452_standby(data); mutex_unlock(&data->lock); if (ret < 0) { - dev_err(&data->client->dev, "powering off device failed\n"); + dev_err(dev, "powering off device failed\n"); return -EAGAIN; } =20 --=20 2.34.1 From nobody Wed Jun 17 05:10:18 2026 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 BF9EC383C97 for ; Wed, 22 Apr 2026 16:57:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877024; cv=none; b=Rws785LmV5VmAV4LT7wXuxu9tycpqX3yI0WAsQx9I5o4NNbzuZeUhrsxs6S9jNaFM8U+0zaUySUrRERuyNj6lapKGeQ4oyJA8E4MqlvOg+y4cG6rd0bp072jfz4/FDJCUpdtzcYZT3FDG7ZC0xJRaxps384Z3GZqPOU5bLSI/yY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877024; c=relaxed/simple; bh=OOT211Qg5Ti/MMGkmp30LRLc49w8nKu+eUOAg3LHjQU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XGQMrUVpJmG7vIAZSb+aAInvHnuLYZtSh2NtBdjImKN3uih/wPyezU/o2rGVd8gNlu0gUFUofn6Gw967Mn9ObNvYpSkTjDbomN8/YbH3whWIhGWjHFNKMZvIhhdB/G5qE/c2MkC1qY1S8s9KhPZgOZv2B8Io2+XnSp/MtbdRzdQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=esgEjj1/; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="esgEjj1/" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-c70ea5e9e9dso2414760a12.1 for ; Wed, 22 Apr 2026 09:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776877022; x=1777481822; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=riaMk8etyq0rzfYVnIkS4yGsS6/2CNoO7Rh/WBiTOh0=; b=esgEjj1/sphdPN6y2Q/ZD5qfPd9ywxli8mMYH1Q2D8mVSkfWcVArLquiOLyvmaL1vN oSR8fFsS5VYIOIJ2wt6zfDCWN/VG5JDLhk7o3vHVwLfP0/6qgrqbn4pBuzzzHUL3jOw2 3QZOWU+8o8EmvyHvQ5f7bEgUY3XI5RfGnJmPhDpLNRfog9DYL+2droTT5A6RmMHMjztr f0s153tnWFxGpteO2EBbkGy5Hujy+NRV0cYgv49XJJGIUZYwQbbT2rO4ONQI2tYpYUPo 4mm2uLUKdElqcW0nQm3Kn/iryQ8CfhAcc+UIA1irRmQs6dQ5XK1ESOvSKL/V4xftER3m jPhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776877022; x=1777481822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=riaMk8etyq0rzfYVnIkS4yGsS6/2CNoO7Rh/WBiTOh0=; b=MBORsPhmLt1ZqD7xwef0FoXsgZ4l+1aEyXYS4Xas+0uym9WSgftFSRRE0gxr7eKhzq DHRmrUJngMcNoS3p4CwSMg0dNeW82FwbEV2NV+zL2lGICEIQIU9xsKSqaFzf37qqQilk UDsCaPLpN3J9UPYWRzQtERQpnLIZE+1sm59fSzBd6iyz/j1tgXoRYaAmThFAesA2LYQP 5vxkoZ7rg9gPSxUYpgj+bTzumbqEK06WsvULcJVZGNhKzrmiHmsKnnAadEYNdAlvSSkz F6wXU+jwY+d63kzV4Oloydo+23mretipFfarBnGd8mlL3Wk46vFxOoXbV0agHRp+7iuf VjAw== X-Forwarded-Encrypted: i=1; AFNElJ/D5bi5QKGcAQgUTY/z7QP7XWO/1ENuRyGc8jjDDDw8YD4MNBez6mFxpX453cKENz5UUD/3ss+xMRuIk+Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5Kp2lBahZYBaReOhMTIJSUggIcZtmiNmTOjGjpQIDV1iWn032 ktqzivqvAPy/3v+rGFXSJIQSnfliTjwzQuO6U493VuGR+dsfrHvlord6 X-Gm-Gg: AeBDievZIuh+GT44EVk/gCp4KV4yn/IrZscFG271fZ0W/PeXj9lB3ydQPgqePEb+lTR Y5EIq8gvww23eVYRbICFVpkfEpLvL0SxKy7ydMIr5A2VaXDwye6Z8wAB8VndtydKjP4/u7f3D2/ fTaPgK2a8PIQ1npqCAxEU0Q/vOtjF9+Qr0yd/xkZHMptQCl/i9kvmtHvolgjlRXeowJGvlYH8S/ n01uqrcyfTZWDg0G9weslOXXeJN3/zP7/0EWW1KwXDIZ2TPAXJBm7y5pVCAp2WTp7yB/eIw3kxs 2Un5feGbFyHE/uqSzalU8kv8rsI9OEwT+5jAEmcNN3gvyasgWKOVg3SWIXQrbuq1UD4Jmen/0JE 6lvKldqK1Ss6y1Qi9V/jpuLUluL2zM0W5xwu3jbhqVS2nz+AvczkeYmHSUePDijfPmYSjdwp4a+ HREKl+iqCAXVMmkhwmPw3VoZ/ocytLwwZGWB9p2CPFU/sGz80HxZMJQCEDzDI= X-Received: by 2002:a05:6a20:3d85:b0:39b:989e:6d39 with SMTP id adf61e73a8af0-3a08d8a947dmr28481466637.35.1776877022097; Wed, 22 Apr 2026 09:57:02 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976fa3604sm11908675a12.14.2026.04.22.09.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 09:57:01 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] iio: accel: mma8452: Use dev_err_probe() Date: Wed, 22 Apr 2026 22:26:41 +0530 Message-Id: <20260422165643.2148195-5-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260422165643.2148195-1-sanjayembedded@gmail.com> References: <20260422165643.2148195-1-sanjayembedded@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sanjay Chitroda dev_err_probe() makes error code handling simpler and handle deferred probe nicely (avoid spamming logs). Signed-off-by: Sanjay Chitroda --- drivers/iio/accel/mma8452.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 99f7763b84ac..d1ae2bf37409 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1563,8 +1563,7 @@ static int mma8452_probe(struct i2c_client *client) =20 data->chip_info =3D i2c_get_match_data(client); if (!data->chip_info) - return dev_err_probe(dev, -ENODEV, - "unknown device model\n"); + return dev_err_probe(dev, -ENODEV, "unknown device model\n"); =20 ret =3D iio_read_mount_matrix(dev, &data->orientation); if (ret) @@ -1581,14 +1580,12 @@ static int mma8452_probe(struct i2c_client *client) "failed to get VDDIO regulator!\n"); =20 ret =3D regulator_enable(data->vdd_reg); - if (ret) { - dev_err(dev, "failed to enable VDD regulator!\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to enable VDD regulator!\n"); =20 ret =3D regulator_enable(data->vddio_reg); if (ret) { - dev_err(dev, "failed to enable VDDIO regulator!\n"); + dev_err_probe(dev, ret, "failed to enable VDDIO regulator!\n"); goto disable_regulator_vdd; } =20 --=20 2.34.1 From nobody Wed Jun 17 05:10:18 2026 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (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 E37E81A681D for ; Wed, 22 Apr 2026 16:57:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877027; cv=none; b=YubUK15lcwMNV0eKJYpf+LTyXpZRV+xHrL/Yhtd3uKPQvIxuVLiC1CAA+F4BXc3iKF9nWZN7zPy4TMD3c9yk0z2RfyWf0yEqh7m5/dFAZgEKvQXJ5pI/TcWv3jI1JjAzfj47Ch7b5qTukfewx83E1hOUHrXikUVmdlYF+SAiNWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877027; c=relaxed/simple; bh=ezpzTaXiSS5tWwZbT+HyQP2Q5+ghg+y+4Ax/LVTfoN8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c60oC1iVvoIO/D5yJdHvbgbgq86xQRntegnrLPfgbRXiRTTBilROIlfssIUFdh5qzLhnEQenMyV5Cv4LsTVRD4rxWz2q+upOhqoaC3SJayi2HaZzCSymBooFhTgi97yIQ4g4OLnDNE9W9oIUPGQsvLFgBRQLJEX9lGKiZCYnBlw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=r0YszkYe; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r0YszkYe" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-c7961d7bc09so2138754a12.1 for ; Wed, 22 Apr 2026 09:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776877025; x=1777481825; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N7IfPX2Kd1lFJfKogZTn7YfG18XsUl0K/gq6N+2NVm4=; b=r0YszkYext8Y+3LVqg+ACvLKp/cWR8Zf1K+2KTTwbx/HQnq8nPi4Mw/cFdvL+Y5LJX Hk0iRwQziTrRDbxaLRyRwEEuiA51SH5OElCOhmXAmkUhBmva58Sqlnfo/v+8ieqHt66h BOVzoAy7VCxGYICfhrdZAanjM1nwr1zdvx8VMZWDOwzijKaFawW444mVp1iGWrQe4qF2 j8II3qZp0hV05WCDQwhmBjucFy7USMUQjjk0HBA+9HzYuF7KwxRh6K4bPbbW0a892sKH O1oYYkvL0Q246AN1GzbMsffhyvtfQPXkp5STMpC/3ht1kiMBka/xLdhAbfLq7asIAZTt x/Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776877025; x=1777481825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=N7IfPX2Kd1lFJfKogZTn7YfG18XsUl0K/gq6N+2NVm4=; b=os4eTGzi2OPUwZEOctLYppdZNujwsmgpsNA7Z2cc/LENBlgfuuSN5fBYywyGQ1VTE8 BAK98cMW63o9ZWspzJFhg7T1G/X/4ucKKWdGS/KE4H8jrFUQdQu7Gk+HzqQv8iWc8Gdx O4rAUFRDmT97mMDtCDRkv/JeM40Kx4IXN+IH5nI0UQD2RZr7N4yRVGF58ev56R9NIIrO l8nnutBTRHp+XcXAHQNTJFQHHuvG1m1Hh3OtYlNoN3JZPS+dSsw05xO1lCelhxuOR6rd 4ASVBmEItsVqPTnSxPdifUIQf6QmdMZLcNj/GphsmeeTv36L94H5XXxTO0k847Iu5wm/ VLjw== X-Forwarded-Encrypted: i=1; AFNElJ8nLGCpXhI6f07U5Ix7mW7gAPcZExt1eO7HRPYCXiJSygXLEbytjEKlGoevTMZcBHBpR9+qwHUQcz4FP3M=@vger.kernel.org X-Gm-Message-State: AOJu0Ywfk9YnpSCFIQvzk6XN3fPw/dCgSE+OZd6wHQ4XRC4YaRqUI30A 9sQMRnSqb7X039SaKM6eZI+Y4YxhY/eqxpsL2spAFxOLPf9q0TI2jU6/ X-Gm-Gg: AeBDiet58/1walsZEt/lza0gDF1m5v/IsH1lTE/8pd/FSx7rdYJom7mSfym7bqKkunX PZp+7WRJ/O3epci5sNPCiz8vlIqPwzjx9/tr1yZrkFL81JZHEYwev8BtV3uS7UmIJDa6pObnDyM RxLEGthYJ5SdmoXpHZ4un+gwHA6fENrz4UpVWUUmOPtsB1UcdiPhsWMOU4hpZAVE1hYUqaXcWsV zQ0A+uOTxpEJCrw6GkQUeV2d2CaGO2G0wsQDNi9MHiliXeoIzAU2GF7Huv0id8fBPMEmDg8Ht23 t9ToOfm4UMjH337yjRwpPgdxCC1O9sjRB1mhFJYZ44vPeVU/Hd//VoAjvatKleTBP1h5KidZc3j hK3sM7kYFtiP4Sxh06k0NeY0g6TrZZDA3WbP6dOfoKgoqkdlGZEGr8yQIvlfkzS19IYY/4tR37U 9bgRf/AFc1xxXSokliBWZEJ9JM8t8kufdBDsfiLE/5rlS2/Gw7ILO0eLN5M9A= X-Received: by 2002:a05:6a20:9194:b0:39f:2b9e:e472 with SMTP id adf61e73a8af0-3a08d68775cmr26519211637.3.1776877025271; Wed, 22 Apr 2026 09:57:05 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976fa3604sm11908675a12.14.2026.04.22.09.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 09:57:04 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] iio: accel: mma8452: use pm_ptr() for dev_pm_ops Date: Wed, 22 Apr 2026 22:26:42 +0530 Message-Id: <20260422165643.2148195-6-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260422165643.2148195-1-sanjayembedded@gmail.com> References: <20260422165643.2148195-1-sanjayembedded@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sanjay Chitroda Use pm_ptr() and DEFINE_RUNTIME_DEV_PM_OPS() so the PM ops pointer is automatically handle when CONFIG_PM is enabled/disabled. This follows modern kernel power-management conventions. Signed-off-by: Sanjay Chitroda --- Changes in v2: - Use DEFINE_RUNTIME_DEV_PM_OPS to address review comment and resolve 0-day= bot warning - Link to v1: https://lore.kernel.org/all/20260414192045.3598010-1-sanjayem= bedded@gmail.com/ --- drivers/iio/accel/mma8452.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index d1ae2bf37409..9983f76a8bcd 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1747,7 +1747,6 @@ static void mma8452_remove(struct i2c_client *client) regulator_disable(data->vdd_reg); } =20 -#ifdef CONFIG_PM static int mma8452_runtime_suspend(struct device *dev) { struct iio_dev *indio_dev =3D i2c_get_clientdata(to_i2c_client(dev)); @@ -1815,13 +1814,9 @@ static int mma8452_runtime_resume(struct device *dev) =20 return ret; } -#endif =20 -static const struct dev_pm_ops mma8452_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(mma8452_runtime_suspend, - mma8452_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(mma8452_pm_ops, mma8452_runtime_suspend, + mma8452_runtime_resume, NULL); =20 static const struct i2c_device_id mma8452_id[] =3D { { "fxls8471", (kernel_ulong_t)&mma_chip_info_table[fxls8471] }, @@ -1838,7 +1833,7 @@ static struct i2c_driver mma8452_driver =3D { .driver =3D { .name =3D "mma8452", .of_match_table =3D mma8452_dt_ids, - .pm =3D &mma8452_pm_ops, + .pm =3D pm_ptr(&mma8452_pm_ops), }, .probe =3D mma8452_probe, .remove =3D mma8452_remove, --=20 2.34.1 From nobody Wed Jun 17 05:10:18 2026 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 14BBD386443 for ; Wed, 22 Apr 2026 16:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877030; cv=none; b=I0LmBJlldaYvacL7TNHk6MmQaV6kNWDQgnTorWtlvlxsE3QzQQnFY/YWfwW9nJmfeP9iV0Ach6s4wBREy7hwuCSziPUrfP8/6KRuzudhPNxlxDmXTvnmz5pIf8bjrvQbfSMqf0wcRcmyGmZc/hP083P762caKm1nf8qT+SsPPvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776877030; c=relaxed/simple; bh=phuovY5LGPNUA1tGMKpHr8w+7ex72MZcp1bQbV/VAnM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jHLo54+uuOnT0qoFBmC0XF2lklFCnr1i/IZ1sX35vV4pFHQqB6Hw+f3NPIoWQdRhQgmJe28t9cIU96qfVGhjzndRhXWkZN90mODlDWYRlD98ybWRDGhUYqFxZOo+xRSaTrwVVngwz8Pv6BY1FPRAVyrGkRA2OQFCabFcs5/zouM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fGqrn23G; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fGqrn23G" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-358e3cc5e7eso3433323a91.0 for ; Wed, 22 Apr 2026 09:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776877028; x=1777481828; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N7RWTZe2CgWdqhLVIQJNNjEv3qVx1AKFr1CFK8ZC+yg=; b=fGqrn23Gj5KQuYQYYjQGh5V8JaO8y/RPEtA/kyQ5tfXz/iViFAKPrGpDvctFZEsdP3 3rWjys0Ar0WBIO2J/F+5SH+F80Bi7VYwMplqDO8nHyZH3++ERLyw8S0T/uY+2ivTfIQL Wtz2b1BZsvr+44LwRUM5HxKAHeu/JyLIfHV6UW5vKD7SybAXaL8cBHVM4L1cuTaihi1Y SYfOPRTXM/BEY9uw+6SGm1tlLeW0dkl07rFn6YTl77VbeMl8IWFzemvzlhcLEb4DjN3W DzygcxiTxRp6XYZ/dAPIyNZFcbLHmxcC2yP66Lv70ICOIo9tap08aOCuQgyPIdPooZWR 7sMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776877028; x=1777481828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=N7RWTZe2CgWdqhLVIQJNNjEv3qVx1AKFr1CFK8ZC+yg=; b=svXarh3kTX6fAj4bPSINTqrrGvAnHb820g2wcWViulECiybSdZKcS7j/Gwg7RotWy0 1M1XZB4ghaOxYs3AHdAYI2+i+GyW2EjiXjnmZGXauaUkQxnaKYqlvK0VS8WHVU9wAcAA QWgwacb5kpAlxREwKRZ5xDqPQhKbA2YotvVi6z70bYldAT0F4ZlqwNdmEilxbMiw3rLZ uB8cZ0c8IGXSSVdE+Ugun5fOkojwTvbRz1FJuh2d/GRnqXrAa0eJH2xAxsJ4Qe2sBw9V Fblz+g+jKNB2v28tx04FKk/MuJq5r3CnFs2c9oegZ3+foo0HAbwz3AoMuK6iYhlj9i9z ixHg== X-Forwarded-Encrypted: i=1; AFNElJ9LUjuOAF3PI7LOaUv/+xaFPTErw0tcwMzYpbXtgIbP4L2nvNPosW9mpxz+rUCYxLOUdhqvt+fGFcRyJyE=@vger.kernel.org X-Gm-Message-State: AOJu0YyykMawngCdsUk0nKu3n+u46rIDGrbSRDf7XBLLfq8JW9mreQ8K BlNunuNPFxb7AWq+fifDeNkGdLCFKSORBZuSw9t+3IfF8ovTrBJJiAK6iE1ZGQ== X-Gm-Gg: AeBDieuxO35oE7caC+Qdqz28BYlwgjGWjtcxlgbfowJjibu+Gp3RSLmsv6KpTmQ2N8W 1eLrFXaSrbY1KjHF2EXBwFM0Bk4S15w394++4t5fUZJU2WBOF//njrT3oQ2joEg+tGMAQpl2MeB Qjt3iCIAuxTRPCPrTqjibTFD+BPJT2+eDNMksv/5eFcenFOzKCu0ETJWkqXC/YpfX/KZgSyaq0J 3MCu+4epTD5kIEzM7wtERNyjlbvoHbL3YvsNAkVuDsoFRkd46qgKAgA7ZB/pjKk5W1jcQWl4est yUXeHet+7UN3eacKLc/hU2uKfY9E4GYVWLX0SXSR9B+3J/TFrD5KxqJsIneCD09eMw/cPx0OqPF OUCMtobOF3mlMzbaMMAFnwpt0j0jSVwXMCWiJg+tpOzKlb5z5LjmicLW6yqVoR9oFmGIO5Wsvdg 7wF8unWnBq8r6M4cZ3Ye7nzkJrfLoIIEehRXo2PuLzUVWh5psvEVf/3wx7NEM= X-Received: by 2002:a05:6a21:3282:b0:39b:f026:6f8e with SMTP id adf61e73a8af0-3a08d897d89mr26229089637.34.1776877028436; Wed, 22 Apr 2026 09:57:08 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976fa3604sm11908675a12.14.2026.04.22.09.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 09:57:08 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] iio: accel: mma8452: use guard() to release mutexes Date: Wed, 22 Apr 2026 22:26:43 +0530 Message-Id: <20260422165643.2148195-7-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260422165643.2148195-1-sanjayembedded@gmail.com> References: <20260422165643.2148195-1-sanjayembedded@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sanjay Chitroda Replace explicit mutex_lock() and mutex_unlock() with the guard() and scoped_guard() macro for cleaner and safer mutex handling. Signed-off-by: Sanjay Chitroda --- drivers/iio/accel/mma8452.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 9983f76a8bcd..1c284bdcc44a 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -18,6 +18,7 @@ * TODO: orientation events */ =20 +#include #include #include #include @@ -500,9 +501,8 @@ static int mma8452_read_raw(struct iio_dev *indio_dev, if (!iio_device_claim_direct(indio_dev)) return -EBUSY; =20 - mutex_lock(&data->lock); - ret =3D mma8452_read(data, buffer); - mutex_unlock(&data->lock); + scoped_guard(mutex, &data->lock) + ret =3D mma8452_read(data, buffer); iio_device_release_direct(indio_dev); if (ret < 0) return ret; @@ -600,36 +600,30 @@ static int mma8452_change_config(struct mma8452_data = *data, u8 reg, u8 val) int ret; int is_active; =20 - mutex_lock(&data->lock); + guard(mutex)(&data->lock); =20 is_active =3D mma8452_is_active(data); - if (is_active < 0) { - ret =3D is_active; - goto fail; - } + if (is_active < 0) + return is_active; =20 /* config can only be changed when in standby */ if (is_active > 0) { ret =3D mma8452_standby(data); if (ret < 0) - goto fail; + return ret; } =20 ret =3D i2c_smbus_write_byte_data(data->client, reg, val); if (ret < 0) - goto fail; + return ret; =20 if (is_active > 0) { ret =3D mma8452_active(data); if (ret < 0) - goto fail; + return ret; } =20 - ret =3D 0; -fail: - mutex_unlock(&data->lock); - - return ret; + return 0; } =20 static int mma8452_set_power_mode(struct mma8452_data *data, u8 mode) @@ -1753,9 +1747,8 @@ static int mma8452_runtime_suspend(struct device *dev) struct mma8452_data *data =3D iio_priv(indio_dev); int ret; =20 - mutex_lock(&data->lock); - ret =3D mma8452_standby(data); - mutex_unlock(&data->lock); + scoped_guard(mutex, &data->lock) + ret =3D mma8452_standby(data); if (ret < 0) { dev_err(dev, "powering off device failed\n"); return -EAGAIN; --=20 2.34.1