From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5B213D3D01; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=MKiKozQI3d2bNulaGoGXrhDp4g7uv0ltiHe4cMysbF8zOHvtEneOZRdOI0E+6/tyHU/HbAPTvNCAbn43gulVn1p2/vB9+RH8GZy016AGkqQWk9B1mH70KWuNlpwui+YprKCBK+rs9f6t1p2wWU65p1ns9PKvvZFjXCDO4rC97oY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=m8yQ6Rt1BmfoSca8nbLNUGHQrRGO6KhHvj/M48iE0QA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qSgcdhi5n9LuPXREy0imumLXqFH0g2xu4loYpwP8U5a+3h92G+IU3Mlmeyddk5TFmu7U1naw7YA70LSd6tFxm1trchdIEsoyxqdKf08xFCixD3MoPXoPAcgiUnPHcbj3reAyPv8tR/TwvQQuwipFSJ8mgnQ5yJlRpruKPlRzhQQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g6I8d+sQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g6I8d+sQ" Received: by smtp.kernel.org (Postfix) with ESMTPS id 84CD8C2BCFA; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540425; bh=m8yQ6Rt1BmfoSca8nbLNUGHQrRGO6KhHvj/M48iE0QA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=g6I8d+sQINcwD+N3vTTsJWxM7xbLUCD5gt9Fk3Wkog57zU9Ya34F1G7/7lzrYvwME eGrGcwZQPrNZFoIQ1pOsfKWpbsqeg3njfpXKJM41YSPj22Y+/OlYPN6khSaN/D5YWI 4LdgIeaWkrCpL0VeD6rBs8NtWNfYKHtjleXc4IUAqBvMyvDxIJunFoReMUcWAIIx5K /tvBpS3s/ImwM8/tMWpwff2O33ltqMdJUFNxsL4gNOYOEwTCBQ+8vTxwKHZqzWRM7R CDRIZuhZgObuaiBmk2JRV2jQ2DBTq5DyeEo+dIqwxChT2drEbaAFww5Px00XONnalG t0G1sRQrxSWfw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 674CEC44515; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:13 +0530 Subject: [PATCH 01/10] iio: humidity: hid-sensor-humidity: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-1-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=1433; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=LsnrdNMs3dMUtTK3CAAIvAss81SC1EE8A5C3AYP1tnY=; b=A8l/C4PtdauXUHADBaRxAw3cHyKxhem+dupRUirYRB+89tMZOq09jwan1Lkb8dBEps0LngH+b ruzXFQxQ3A/C0CjUBYA4pdZzLK4bgtU8NOA61dFIQutOF83b2oMUMGD X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/humidity/hid-sensor-humidity.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humid= ity/hid-sensor-humidity.c index 7cec81ff5685..1b254d3aeee9 100644 --- a/drivers/iio/humidity/hid-sensor-humidity.c +++ b/drivers/iio/humidity/hid-sensor-humidity.c @@ -196,10 +196,11 @@ static int hid_humidity_probe(struct platform_device = *pdev) struct iio_dev *indio_dev; struct hid_humidity_state *humid_st; struct iio_chan_spec *humid_chans; - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(*humid_st)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*humid_st)); if (!indio_dev) return -ENOMEM; =20 @@ -215,7 +216,7 @@ static int hid_humidity_probe(struct platform_device *p= dev) if (ret) return ret; =20 - humid_chans =3D devm_kmemdup(&pdev->dev, humidity_channels, + humid_chans =3D devm_kmemdup(dev, humidity_channels, sizeof(humidity_channels), GFP_KERNEL); if (!humid_chans) return -ENOMEM; --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5A183C4546; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=CYNVEcG+TY68AQOJnFgi06R/+x94mlp+IbYUI/LFpowI2hkRODcbTdihZhjOuMk0OTS2dGy4INvTczobiu/qGhWsZlFDuyABdFC02RToeu4qrgkxTyNiX/cT0SWmSrrkk8HolkxxAMUrWKy23aAV25Z1GRVNx/g/5ItJqUIXU9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=+9v4q9BYAVKlGMelfBqiS4gsgM3yxHv0naNXqba2YMg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ulplu2GkCc199/3yT5kZ4YhVRFcv2drY+vPX8htm/I2BFbmOAl8CTF0rMSHETtt9Rg0XmYzbw74xvl/ray3b97aO865fnRsCvyzqAW9PBkZ1wrjOWrRHkCzPY+jINVWADdCRGhAAxyethIPfm38OoyrwiGkDe7xmT0yUeNUDLwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LGIDo39z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LGIDo39z" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9751BC2BCF6; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540425; bh=+9v4q9BYAVKlGMelfBqiS4gsgM3yxHv0naNXqba2YMg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LGIDo39zN/OZEY41q/dckexL9JYV5PxvYuzNmambh4raTOHsmvQSmVax/XgaUv2bG bYzKFeRsn05tG8MxIO2foVj54PkdzOX41Wch3gb1hs033BktjBEDV7QJ0AtMka61Gz zZ8A80L8BSAonmT1G94xNl8u6nXiXW4m7P83AntqgcPe15gRyaDL8pQ2y89BoUFijk EAUZYzQnK0ixO7oxJVuBORPaSvsFysnlcsw71KC77Iv4XJ0LB8dcq9Yyl9rAk7OmOZ OSxSaGYGpFOe/H2tPkyub0EfnSPiq2Ckjp3Rx/P5Yv4aDsjINq2h1vTgyF4noBqnT/ SRJRxm4gGERaw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A08EC44527; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:14 +0530 Subject: [PATCH 02/10] iio: gyro: hid-sensor-gyro-3d: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-2-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=3130; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=sbocTFLcC7tO6VvGktZQw3Yf/IDevdn1SGxGLRUlz/g=; b=BJ+AWfejLnjSYVYfisGbfjSIB04eZhmotWpzs1BSZPGKg8MnCcQXd95YB0IZxLS1Hf0qpDyuq bpPhFUuPWngDOyxofIcldqJsIeFsxnrBAK9yzixovyd3JVdjVviLIno X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/gyro/hid-sensor-gyro-3d.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-s= ensor-gyro-3d.c index 58250a972567..8ff3ceda6dab 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c @@ -264,13 +264,14 @@ static int gyro_3d_parse_report(struct platform_devic= e *pdev, /* Function to initialize the processing for usage id */ static int hid_gyro_3d_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret =3D 0; static const char *name =3D "gyro_3d"; struct iio_dev *indio_dev; struct gyro_3d_state *gyro_state; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(*gyro_state)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*gyro_state)); if (!indio_dev) return -ENOMEM; platform_set_drvdata(pdev, indio_dev); @@ -285,14 +286,14 @@ static int hid_gyro_3d_probe(struct platform_device *= pdev) gyro_3d_sensitivity_addresses, ARRAY_SIZE(gyro_3d_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } =20 - indio_dev->channels =3D devm_kmemdup(&pdev->dev, gyro_3d_channels, + indio_dev->channels =3D devm_kmemdup(dev, gyro_3d_channels, sizeof(gyro_3d_channels), GFP_KERNEL); if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + dev_err(dev, "failed to duplicate channels\n"); return -ENOMEM; } =20 @@ -300,7 +301,7 @@ static int hid_gyro_3d_probe(struct platform_device *pd= ev) (struct iio_chan_spec *)indio_dev->channels, HID_USAGE_SENSOR_GYRO_3D, gyro_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -314,7 +315,7 @@ static int hid_gyro_3d_probe(struct platform_device *pd= ev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &gyro_state->common_attributes); if (ret < 0) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -324,13 +325,13 @@ static int hid_gyro_3d_probe(struct platform_device *= pdev) ret =3D sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_GYRO_3D, &gyro_state->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E76163D45CB; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=U3O2XnrMmRoFZw0GOHVGOOEVDGwkRfi7jthGzy17d8TeFXOmi62UgaLWEd2QQ0+UplIW+DriVSY/5xWqSwhBUYtd7iHhiKw/rw10BRsN2VWqSLVeeQOVqf5gOIQLRfFvXKtx7hVlXg/VRt563DFYgtq2DrQVN6zAOqmuZYesDbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=f/RNp5qcwybkfeN/HanUf56pHEeRgjyLnoKetz64Vhc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oCK8ZpvO9XuhbKjDOhhhy3NVWG1YApdMA6BHox9mJjK9SzFCFIDD1KrT1Mdr37I1HXFXNR1vEuSUq8dXReFw8YIqe2g+5kNb0ARkWNRr6xJmqn7S6BqvF8r/9Z5TZytc/0iQYm7joTFHwm+UaHkqwvB5hVUmFNZpr8Pl9P0DiyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fSQ3PxQN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fSQ3PxQN" Received: by smtp.kernel.org (Postfix) with ESMTPS id A4E37C2BCFD; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540425; bh=f/RNp5qcwybkfeN/HanUf56pHEeRgjyLnoKetz64Vhc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=fSQ3PxQNOP4nP9kkYE+JgZVWKqa3j0x6XzqvTcXyalWZ1RFgbQRTgjGEFdV+JInea fI8toILJxnLuHBTaMzySOnbmF1XGcgfN/ol3YAmXwUcSvDO03ml4Y7/lzGBb5YwtU5 zrVB7DVcCB3Do7G03F+THvWu20rbyBRxZrBjEIVLOcqCCdtK2wwAuPxXMl5JcSY6il LNXFGzCWmIKF7dgF+vQzLZanfo6VhtkU3JUgFtmaKcM0EsbDAvHLaZsvSOgOoj9Rvh xTECvThXaXR+OONbLHLTyWOMb26U/9h6/+9Dmwe4bmjXbosgrD90vIYdAdPDRzm11W ZnSFhvptY9t7g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C328C44528; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:15 +0530 Subject: [PATCH 03/10] iio: accel: hid-sensor-accel-3d: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-3-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=3184; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=CHrL5pLuWoANqRnTUQhBxvjRxrsqGaR+mjcFFDbcdqU=; b=jvPykdZK1FZL5BRq/q/lUtRSM7gO1wAB8CWI2GuTQYgmVnGABIc0qmpbT/Zod8t+3/eDeIOxv TstVMjJkp46C+vNCunsNzJt0K/Y7cHTZ8MprvLUPE48EpKBd4bmLbfZ X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/accel/hid-sensor-accel-3d.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hi= d-sensor-accel-3d.c index eb521125f4eb..5467ecc86b58 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c @@ -314,7 +314,8 @@ static int accel_3d_parse_report(struct platform_device= *pdev, /* Function to initialize the processing for usage id */ static int hid_accel_3d_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret =3D 0; const char *name; struct iio_dev *indio_dev; @@ -322,8 +323,7 @@ static int hid_accel_3d_probe(struct platform_device *p= dev) const struct iio_chan_spec *channel_spec; int channel_size; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, - sizeof(struct accel_3d_state)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(struct accel_3d_state)); if (!indio_dev) return -ENOMEM; =20 @@ -350,21 +350,21 @@ static int hid_accel_3d_probe(struct platform_device = *pdev) accel_3d_sensitivity_addresses, ARRAY_SIZE(accel_3d_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } - indio_dev->channels =3D devm_kmemdup(&pdev->dev, channel_spec, - channel_size, GFP_KERNEL); =20 + indio_dev->channels =3D devm_kmemdup(dev, channel_spec, channel_size, GFP= _KERNEL); if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + dev_err(dev, "failed to duplicate channels\n"); return -ENOMEM; } + ret =3D accel_3d_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels, hsdev->usage, accel_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -377,7 +377,7 @@ static int hid_accel_3d_probe(struct platform_device *p= dev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &accel_state->common_attributes); if (ret < 0) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -387,13 +387,13 @@ static int hid_accel_3d_probe(struct platform_device = *pdev) ret =3D sensor_hub_register_callback(hsdev, hsdev->usage, &accel_state->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E757D3D45C3; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=q9rtc566U389lMQFpMuSksL0aPpGFeFpf3Z1ACm2hLRTquvzuTEZ4DihuLAFNg6OaCevC3bi8MCGnqdwYvSfYddyrUtzZiNHvYk1jC6gf2A3bTvhjNsE9jR0Wwfxfa7A+5oz19CN4Vqal3W3y3BmNSnseMLGuW3MQG2Tze/6Lz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=zaBr0PDxlFDjbKhNg4TNqfr5zCslyQt2+TdQ+qr5rqc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gUWNaY9UG5eI+3wfYghZIj/M6HI6ihcWQTaofCsEJW+eI8NBhUax+0zlGKH2sh9bq47N/x83URILK7jf4W4KDVteTaxUeqDOjWUgy+Sfo/uLS1ITA9OQwtLWXh9kntjiBPtZVR0EGmQYGuUx4eBPUp/lQlcEOwzpz0ZzSmeVDOk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UaAxnxVQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UaAxnxVQ" Received: by smtp.kernel.org (Postfix) with ESMTPS id B3B6FC2BCFB; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540425; bh=zaBr0PDxlFDjbKhNg4TNqfr5zCslyQt2+TdQ+qr5rqc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=UaAxnxVQ9asaSfmBmA6zjsMt6AY7KSLl4zXKURa6nxL+T39pBZ7OUynlGB6LV5u7W nPh/H8x8rAphgrZN8iNTQIHlmgLbKOiDFzYekywixIxAiA6PLVBO5PY957SI3rej8s LW64jXk0Ff1w42XxHgxMIuK/u9dyidZ4F0qXHaW/C4swi8SnWZmF+8cFUIuYrCnVjB CmHcJVKfbeY+LnQsbhayY8cmUmmWpbkkVWyEJqOrbfcdYZ9yS/syjV8TvukhS+WUni KbUVdv8mYh1FfeCK475Vxl4wT8wTbjLhTChztVrIkz5yfU28Z3qO8dEZaBhO3awrg3 Tc4CMWqA5ofvA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D628C44525; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:16 +0530 Subject: [PATCH 04/10] iio: light: hid-sensor-als: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-4-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=2688; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=F+9XUfQNCvbfNIZ2ifuF+mpRN7/StD6NN5AhbF5V6Y8=; b=Y+oYtiAJLpfMR6CVD19JRUm0qQnntcGFjkjixGjdZlhJsIWR58mOnAbfnVXlfLRkMEGkrfRa1 U+LUfTprABvBrXvlxJgt5Y1Ao20GAjzSB+4H0gC0QOmO7TlQ00NSfd9 X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/light/hid-sensor-als.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sen= sor-als.c index 6fb6ace26834..44088f9dff81 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c @@ -346,13 +346,14 @@ static int als_parse_report(struct platform_device *p= dev, /* Function to initialize the processing for usage id */ static int hid_als_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret =3D 0; static const char *name =3D "als"; struct iio_dev *indio_dev; struct als_state *als_state; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(struct als_state)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(struct als_state)); if (!indio_dev) return -ENOMEM; platform_set_drvdata(pdev, indio_dev); @@ -367,7 +368,7 @@ static int hid_als_probe(struct platform_device *pdev) als_sensitivity_addresses, ARRAY_SIZE(als_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } =20 @@ -375,7 +376,7 @@ static int hid_als_probe(struct platform_device *pdev) hsdev->usage, als_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -397,7 +398,7 @@ static int hid_als_probe(struct platform_device *pdev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &als_state->common_attributes); if (ret < 0) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -406,13 +407,13 @@ static int hid_als_probe(struct platform_device *pdev) als_state->callbacks.pdev =3D pdev; ret =3D sensor_hub_register_callback(hsdev, hsdev->usage, &als_state->cal= lbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32F063D6662; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=qL4Ju63F01eyyB2C/q9krSFugQ3uVcqJsllHqskIYyQf0ToPwDfsblzOS8firE/4Om31QYBWWKnTmMW9YpMr75VdFD9q4rfi3Qe7cW/FfyW0k9me+v+Xj+22X/eT/AX8TK6b+fA6zcT+/ZEN9mcb6X/nSqECT46IcADP8nurapU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=NCOfztZyq77uNFx8wStBag95ysryTVtpTDs/tH+si8E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DktgxqEWF+PGzUw9uyzW9oZnSjXgSyPc7Qhm+R3U15s9wzzPMLqTAHKvawSaGfiCeo5CWPodUO1FKu9OwHyttQcVw5gdz24Yo3/NituAmHLkM4xRkkQwf5EgbmDtBXaTOWtoGEaCiTh0ZZEFQjYIkSZFjM7l9Acc746FjgGUQYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GLpZxfA3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GLpZxfA3" Received: by smtp.kernel.org (Postfix) with ESMTPS id C8390C32781; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540425; bh=NCOfztZyq77uNFx8wStBag95ysryTVtpTDs/tH+si8E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=GLpZxfA3N3KoQH5siDoBugS72xxXVME6mg/9BkS2SbCDESEwlYMCNPIQgLcbtEnL0 /Yc9T8xtRtNBK0G9uiGaFcQ9fPYBhq6rvKufN9ZIExuM2eJ/sXU6rWrIfFuYJzHhHU n0Slgj7grudoH0cIxqxC55TwBBlai5FNJgmYyFoh/ZUFU379pQa5HAK1BcI141WjJH eu70gbwaUBgPAv2XVwU2zio/Cp8Qkk7czi/ktiV75YX3dw0vF+F/bpZ8bRUwciUD8e mkXVOw2znxNhgwq7ER01R4Ko5CC56shAHd7iQdEUg0I40GLRujVNwBKFKBaEG0rzOf crC5lMD3kJd0g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5EE6C44515; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:17 +0530 Subject: [PATCH 05/10] iio: light: hid-sensor-prox: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-5-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=2605; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=7IEUJ7GehDEbevcdEbVmc72XuPyYDVyBe9W1Pn/2AZo=; b=eMfxO4F4HaKBiIyMvMz1CG87O8xv8otT0Q3/62nTcgy+LhSBaMi+dEjmc9z+AfzoXQoQEgXqR 4KqV0GuNPb+AfYhiFg9TujzlVCoa4SWT3vl3SAs5ZNRhVnZijtAObdG X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/light/hid-sensor-prox.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-se= nsor-prox.c index 63fd3eff171c..e7fe40726385 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -260,13 +260,14 @@ static int prox_parse_report(struct platform_device *= pdev, /* Function to initialize the processing for usage id */ static int hid_prox_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret =3D 0; static const char *name =3D "prox"; struct iio_dev *indio_dev; struct prox_state *prox_state; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(struct prox_state)= ); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(struct prox_state)); if (!indio_dev) return -ENOMEM; platform_set_drvdata(pdev, indio_dev); @@ -280,13 +281,13 @@ static int hid_prox_probe(struct platform_device *pde= v) prox_sensitivity_addresses, ARRAY_SIZE(prox_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } =20 ret =3D prox_parse_report(pdev, hsdev, prox_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -302,7 +303,7 @@ static int hid_prox_probe(struct platform_device *pdev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &prox_state->common_attributes); if (ret) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -312,13 +313,13 @@ static int hid_prox_probe(struct platform_device *pde= v) ret =3D sensor_hub_register_callback(hsdev, hsdev->usage, &prox_state->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32E353D649F; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=g167AzA49aIyVDGT5UmQKgDqaAqPxkQfMVUZtn0rrMVa/Ec+VWgYcC/aZeLbs9co2mkcc++Sks919810m1YYyf+3fO6AYr7HUumEBgci1UtSjfDecjE6a1m8w6Mzzhx2gBmlaqT1K5k3wT+kPCfBnSDH6/WourMvIQoUIZBME+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=RkMRyxbK/IcHIB1V6VQ8y8wKqy1o4F7ywwpz6kytXYU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=a61Z3ZDS3/l4FzUEfYJqBGusa6PRpKAnthpBYLPOjJTfGQ6ByHB71/nU9qj7KmTPd1UCo/nZFHztfRZKMALvyggN6G7iN/1eEEWLVZaxAPSy4Za9wopwlAup3fRB+MAY3KWyusx5xnRgsrCnaHyAHDRJ7JK+2I20pKCLz7z8GFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c305l9/q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c305l9/q" Received: by smtp.kernel.org (Postfix) with ESMTPS id E2F5DC2BD04; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540425; bh=RkMRyxbK/IcHIB1V6VQ8y8wKqy1o4F7ywwpz6kytXYU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=c305l9/q2IHEWEL95RyE6O9lNipokpxAY9XgL9FhAysp8qAmX42F7sqwyR+p6nrtd PM4aVwZxgug/IIcm+wDO+/nz97exhBTsReX6AB+wOEGyEtHW4fuyW+y3NU+Ep+UsEd 3RYCpMeZXm9nrMmVZEmOvGyyT7t3ts2rne/KzOay4vsmuUIEcScMxnRqtnUgfcKNWB umioPb/Iz3BkPVMc+dKrrntBdWZwBQZM+IwuIe+MbmoMaTBOZFQVPlXJXEYGq4ux8x jPWkq+iVPwsEedy0YBlMQaBtBDpUrAh0mXQdYUEaRBLob2OgfEuBrbllvJwITRF9hd Dy8QlqRSOFBGQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D13C7C44521; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:18 +0530 Subject: [PATCH 06/10] iio: magnetometer: hid-sensor-magn-3d: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-6-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=5803; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=YcOmzT5cC/xJwy/yQyWOjATzzvkHHHTaevRR0MmJczM=; b=WGETJTQxWY5k5eqWvp33D6N1o+Ng6+pWgbHDfsAWMQAyzfKxjgz27FK7s8jACacy9yT8Ti0/F DyMYsh3X303ApaiTdFuV6Pp55kpdAD7MKG1LozBrEkAhZjsWfws/jcI X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/magnetometer/hid-sensor-magn-3d.c | 43 ++++++++++++-----------= ---- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/ma= gnetometer/hid-sensor-magn-3d.c index ad18f233ee16..c9077adde882 100644 --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c @@ -337,6 +337,7 @@ static int magn_3d_parse_report(struct platform_device = *pdev, u32 usage_id, struct magn_3d_state *st) { + struct device *dev =3D &pdev->dev; int i; int attr_count =3D 0; struct iio_chan_spec *_channels; @@ -357,35 +358,30 @@ static int magn_3d_parse_report(struct platform_devic= e *pdev, } =20 if (attr_count <=3D 0) { - dev_err(&pdev->dev, - "failed to find any supported usage attributes in report\n"); + dev_err(dev, "failed to find any supported usage attributes in report\n"= ); return -EINVAL; } =20 - dev_dbg(&pdev->dev, "magn_3d Found %d usage attributes\n", attr_count); - dev_dbg(&pdev->dev, "magn_3d X: %x:%x Y: %x:%x Z: %x:%x\n", + dev_dbg(dev, "magn_3d Found %d usage attributes\n", attr_count); + dev_dbg(dev, "magn_3d X: %x:%x Y: %x:%x Z: %x:%x\n", st->magn[0].index, st->magn[0].report_id, st->magn[1].index, st->magn[1].report_id, st->magn[2].index, st->magn[2].report_id); =20 /* Setup IIO channel array */ - _channels =3D devm_kcalloc(&pdev->dev, attr_count, - sizeof(struct iio_chan_spec), - GFP_KERNEL); + _channels =3D devm_kcalloc(dev, attr_count, sizeof(struct iio_chan_spec),= GFP_KERNEL); if (!_channels) { - dev_err(&pdev->dev, - "failed to allocate space for iio channels\n"); + dev_err(dev, "failed to allocate space for iio channels\n"); return -ENOMEM; } =20 /* attr_count include timestamp channel, and the iio_vals should be align= ed to 8byte */ - st->iio_vals =3D devm_kcalloc(&pdev->dev, + st->iio_vals =3D devm_kcalloc(dev, ((attr_count + 1) % 2 + (attr_count + 1) / 2) * 2, sizeof(u32), GFP_KERNEL); if (!st->iio_vals) { - dev_err(&pdev->dev, - "failed to allocate space for iio values array\n"); + dev_err(dev, "failed to allocate space for iio values array\n"); return -ENOMEM; } =20 @@ -412,14 +408,13 @@ static int magn_3d_parse_report(struct platform_devic= e *pdev, } =20 if (*chan_count <=3D 0) { - dev_err(&pdev->dev, - "failed to find any magnetic channels setup\n"); + dev_err(dev, "failed to find any magnetic channels setup\n"); return -EINVAL; } =20 *channels =3D _channels; =20 - dev_dbg(&pdev->dev, "magn_3d Setup %d IIO channels\n", *chan_count); + dev_dbg(dev, "magn_3d Setup %d IIO channels\n", *chan_count); =20 st->magn_flux_attr.scale_precision =3D hid_sensor_format_scale( HID_USAGE_SENSOR_COMPASS_3D, @@ -439,7 +434,7 @@ static int magn_3d_parse_report(struct platform_device = *pdev, HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS | HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH, &st->rot_attributes.sensitivity); - dev_dbg(&pdev->dev, "Sensitivity index:report %d:%d\n", + dev_dbg(dev, "Sensitivity index:report %d:%d\n", st->rot_attributes.sensitivity.index, st->rot_attributes.sensitivity.report_id); } @@ -450,7 +445,8 @@ static int magn_3d_parse_report(struct platform_device = *pdev, /* Function to initialize the processing for usage id */ static int hid_magn_3d_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret =3D 0; static char *name =3D "magn_3d"; struct iio_dev *indio_dev; @@ -458,8 +454,7 @@ static int hid_magn_3d_probe(struct platform_device *pd= ev) struct iio_chan_spec *channels; int chan_count =3D 0; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, - sizeof(struct magn_3d_state)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(struct magn_3d_state)); if (!indio_dev) return -ENOMEM; =20 @@ -475,7 +470,7 @@ static int hid_magn_3d_probe(struct platform_device *pd= ev) magn_3d_sensitivity_addresses, ARRAY_SIZE(magn_3d_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } magn_state->rot_attributes =3D magn_state->magn_flux_attributes; @@ -486,7 +481,7 @@ static int hid_magn_3d_probe(struct platform_device *pd= ev) &channels, &chan_count, HID_USAGE_SENSOR_COMPASS_3D, magn_state); if (ret) { - dev_err(&pdev->dev, "failed to parse report\n"); + dev_err(dev, "failed to parse report\n"); return ret; } =20 @@ -501,7 +496,7 @@ static int hid_magn_3d_probe(struct platform_device *pd= ev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &magn_state->magn_flux_attributes); if (ret < 0) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -511,13 +506,13 @@ static int hid_magn_3d_probe(struct platform_device *= pdev) ret =3D sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D, &magn_state->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 346CF3D667F; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=RPvWbNDSR4mE4r5Gw4XTAb/d1I1mXZTqZoCSwHFjk6eXyLICPj/Z8V8+DkLIqksd5K4YLa3Fy9qSXAqdyt7JLiCEZoiPFIz3KdP4H/1cz5V+WYgOaJZQarB68Y2tuvg7rfOb49ja6zOIs/kH0CnZet1RmQ/M7B8DApBaOicOj8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=+ua+D9S3TnwwHxCnPvi2ZmOquKQt/HKi3Xg9VC0hues=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tpLb9CxG4pr3Ido3By96jdEeIRjU00NzaqUGIFRE5Iq7lDZTOu13ZeUgSPIM3Mw4apEqKNWnoD33Lweo1kgWBosdMp3x5Ipo0CnMZveVQ+yrO9aeeCBhBGEfDS1B0SPUFENZcsW6etYLUTl7cnuWUeefw+Ks/HgMVgi/LY83D8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tm+W8kbz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tm+W8kbz" Received: by smtp.kernel.org (Postfix) with ESMTPS id F0E3DC2BCFC; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540426; bh=+ua+D9S3TnwwHxCnPvi2ZmOquKQt/HKi3Xg9VC0hues=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=tm+W8kbzLeN2WZeN8orp5usxV/2FkBIJ/QuhK/1Mtp7j5NBJA7AV3CiAEzNIjOCgI VbRssdEbFmOWqAJPhK7X7WUTM24DinukwFo+wweCPV+j7rpCRDxtdWV70MaBUMwRqA JGkEx80t2/97nNc3itpMFPu+iDTg8ZiqsPnojiVyXmC462ScmQ70AlBCwHR+mq+eAO 3ytPnzO28Du0oemOjLw3NrSjsB85PQWmW8YDvEXhz/NcRrmMYGeYUF+wFt+gDDiu0j N9Qa9S5M5I2L5zudAYde+kQ+snjKz6PphTp/tulcNFYgaMmI/qjM0Rl175N2iDS/AN YWiPZ9jMPZvRg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0EB4C44525; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:19 +0530 Subject: [PATCH 07/10] iio: orientation: hid-sensor-incl-3d: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-7-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=3070; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=V5UXFAlSPanQN9gs2HGz9qITKyYoV6OuXxqP/NGEa/Y=; b=D7vt8syI2oxwosTVoFt+oAH202h7xOa5P+L3z+qyd/qWd1kPjcSDWX98A4jTYSC1aoOppzc0h Ak0O9onSHo0A8mDA+5Iqu4f+lz0am+0QVkJ1RYVBCSYHvHbjdstQCn4 X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/orientation/hid-sensor-incl-3d.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/ori= entation/hid-sensor-incl-3d.c index aea28321db95..ff28aed47c75 100644 --- a/drivers/iio/orientation/hid-sensor-incl-3d.c +++ b/drivers/iio/orientation/hid-sensor-incl-3d.c @@ -293,14 +293,14 @@ static int incl_3d_parse_report(struct platform_devic= e *pdev, /* Function to initialize the processing for usage id */ static int hid_incl_3d_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret; static char *name =3D "incli_3d"; struct iio_dev *indio_dev; struct incl_3d_state *incl_state; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, - sizeof(struct incl_3d_state)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(struct incl_3d_state)); if (!indio_dev) return -ENOMEM; =20 @@ -316,14 +316,14 @@ static int hid_incl_3d_probe(struct platform_device *= pdev) incl_3d_sensitivity_addresses, ARRAY_SIZE(incl_3d_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } =20 - indio_dev->channels =3D devm_kmemdup(&pdev->dev, incl_3d_channels, + indio_dev->channels =3D devm_kmemdup(dev, incl_3d_channels, sizeof(incl_3d_channels), GFP_KERNEL); if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + dev_err(dev, "failed to duplicate channels\n"); return -ENOMEM; } =20 @@ -332,7 +332,7 @@ static int hid_incl_3d_probe(struct platform_device *pd= ev) HID_USAGE_SENSOR_INCLINOMETER_3D, incl_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -346,7 +346,7 @@ static int hid_incl_3d_probe(struct platform_device *pd= ev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &incl_state->common_attributes); if (ret) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -357,13 +357,13 @@ static int hid_incl_3d_probe(struct platform_device *= pdev) HID_USAGE_SENSOR_INCLINOMETER_3D, &incl_state->callbacks); if (ret) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 330B93D666A; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=duEr3kB2T0SMgrcTpUtJWmBE3LelImRkmJVSiCoXkeuKIGqVo5CPyKp2DiWPkuOzbG193+r/aIE6MOUW2zZfSAu/Wunu1mSJpMPKnlBTRyyvAdG+FLVqCX8KnES+l5uAI4i4znJVc4PtPDv+ELn/NHyXuuA7h7cglnaC5niUgmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=scSMD9yfVL5TOLx3EN/arGlReo9ABOVwOR2n8mT04ok=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SQg+VKrlDVjBcfuIl5tc4maP3/7dUjJ4/34FGoQMPv7UNa03DEYSNSUKy7DdMSDC+5rFH8iXLsAR4Hyl2xjKUacrtw6WP1PFQ0M4seKQYwnZYTCqED2df5igKtd/ZzFk1vOMjRan2j6hJv2Pp/8+77DoL6oJdjjlZDypnsnE+xg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uOtvdwSO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uOtvdwSO" Received: by smtp.kernel.org (Postfix) with ESMTPS id 09E32C2BD05; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540426; bh=scSMD9yfVL5TOLx3EN/arGlReo9ABOVwOR2n8mT04ok=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uOtvdwSOHm0kReQqJh8JHTlNzxoZm1t2RGC+HBgQIPrgYuROt1uf/v/daFrhDORD4 NNhrc6wqbVIjTTmmeEcDdfjf6AXViyqs1RI1dxY31xB4dfK99PfhgHC16gUj0y/0aw 0fBcEZ7c46/OfuUHBBzMGnWT7Ji/JnnS4HG7Yghs2Lhb/EP16Y5KJSx71z17hrJj3a DW9NcGN8QttS9q8Lg2V2qS5HVZRqmywqOeEuKmJL4dPy+t4lZkBs+NOK38Uwo5jl9h Pig0jag9xYRI8Ld8zhlw5CPASVBosQN9NRFPUClDWnQ7fUOq2I0fjpB2rPAKbRlg8k fVQTVpnEzC4zQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFF10C44529; Mon, 20 Jul 2026 09:40:25 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:20 +0530 Subject: [PATCH 08/10] iio: orientation: hid-sensor-rotation: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-8-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=3414; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=5/qXdvEQ0B9F64BZkAHHH7V+NgRa7Impnj2qIRjxP4Q=; b=cVVzT3tBshdolEVrxo3qxVbdqjBCh5wsAh1ITk3Yt7815M8Bv8dRw7uLu0FYRk3ZAMY3VWFSA +oh0B+u0ixjAipgf5doQIEgPHdLDwkmG1/KU35ZkA5iBuHEVvesE9bJ X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/orientation/hid-sensor-rotation.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/or= ientation/hid-sensor-rotation.c index 9e13a0ecd584..50a684efeb45 100644 --- a/drivers/iio/orientation/hid-sensor-rotation.c +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -238,6 +238,7 @@ static int dev_rot_parse_report(struct platform_device = *pdev, u32 usage_id, struct dev_rot_state *st) { + struct device *dev =3D &pdev->dev; int ret; =20 ret =3D sensor_hub_input_get_attribute_info(hsdev, @@ -248,11 +249,8 @@ static int dev_rot_parse_report(struct platform_device= *pdev, if (ret) return ret; =20 - dev_dbg(&pdev->dev, "dev_rot %x:%x\n", st->quaternion.index, - st->quaternion.report_id); - - dev_dbg(&pdev->dev, "dev_rot: attrib size %d\n", - st->quaternion.size); + dev_dbg(dev, "dev_rot %x:%x\n", st->quaternion.index, st->quaternion.repo= rt_id); + dev_dbg(dev, "dev_rot: attrib size %d\n", st->quaternion.size); =20 st->scale_precision =3D hid_sensor_format_scale( hsdev->usage, @@ -265,14 +263,14 @@ static int dev_rot_parse_report(struct platform_devic= e *pdev, /* Function to initialize the processing for usage id */ static int hid_dev_rot_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret; char *name; struct iio_dev *indio_dev; struct dev_rot_state *rot_state; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, - sizeof(struct dev_rot_state)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(struct dev_rot_state)); if (!indio_dev) return -ENOMEM; =20 @@ -302,13 +300,13 @@ static int hid_dev_rot_probe(struct platform_device *= pdev) rotation_sensitivity_addresses, ARRAY_SIZE(rotation_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } =20 ret =3D dev_rot_parse_report(pdev, hsdev, hsdev->usage, rot_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -323,7 +321,7 @@ static int hid_dev_rot_probe(struct platform_device *pd= ev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &rot_state->common_attributes); if (ret) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -333,13 +331,13 @@ static int hid_dev_rot_probe(struct platform_device *= pdev) ret =3D sensor_hub_register_callback(hsdev, hsdev->usage, &rot_state->callbacks); if (ret) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5027F3D6CC1; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=ADGDCtm2RpxnJEHBq6v8nwJsgUll/oe7CoX7DtHBymBM1ufPuivdt99aITvE3/DmUEvoORMUmy5sMt/4c9gTIxAz4i5IUgf5aS/lqLYaW0oC91tXq06xYlKAXlJQ1oosXxfCIG+TPH/gOpSQVu2J8iS12Tvi0Yb21uszdGlMPP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=MPeOdP4SkOcASrgCV4avFzAju0M+4lDARLhfqkXVOdQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TLNrWFt5lA6J+pvbRb27QUh+rqssd8qAG8BNJlR1S+uHGVFavdpe9zDmNpud6ryw/cEcXFT+cAcPuqmEn60LmL1nKCleJExbQAq4FM1bVyloOAv85rJu3LFieefSR0ec1Zemt7uAaYgHhvfS/04ksJ/PiOREEYTlQeivu0oc54s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hFHhimgw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hFHhimgw" Received: by smtp.kernel.org (Postfix) with ESMTPS id 243B5C2BCFB; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540426; bh=MPeOdP4SkOcASrgCV4avFzAju0M+4lDARLhfqkXVOdQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=hFHhimgwAarhdRYALQH+BVBU7/udLOiZilYuJwZ5dzqSb2BG8OIcM0wCQj/QmEFkb VNHYsQWA6XxLm1u+q4TZLUWZi/1iF9hgAi13s+l2TclCSNdtrocAIEgwJ4qjYRqGJI ZVSOexi5aqbOb0PbFxwL5OIy7ELA3fF/7hQAdBKtewB28NZqx4Uv4GQKSnEE7xve2Q ML1gVnDWSrhrwBjv8X4Uc4p2F1NXTNDmD6+jbgg+80gWPra4g50/rMD90RqmqXeOKf yiQudReI1kOi7xT0tfVpJe+zuBgDvZzw0ubdLMwJ5zT+B5oT5lhtOJLhslo/eWfe2k EbnMBA85QXArA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 127E9C44515; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:21 +0530 Subject: [PATCH 09/10] iio: position: hid-sensor-custom-intel-hinge: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-9-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=2998; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=335qLwG5/pzStAQdngH/Ah3Hgz4pPlTw4zyMjA4o7Lw=; b=hzPvTzO1/FjX0EBZLY4GGVtTYfYQAZZphUrit8Xxg7vVCznoema1xjSXTn6HInQVKy+Ul9FBA i3Xk8zOP1YfAptwnAWjUjV5pfC33VdYxPzAurA9BtbChAkDv7oC+f0Q X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/position/hid-sensor-custom-intel-hinge.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/iio/position/hid-sensor-custom-intel-hinge.c b/drivers= /iio/position/hid-sensor-custom-intel-hinge.c index d275bc1413fe..febc32f5a332 100644 --- a/drivers/iio/position/hid-sensor-custom-intel-hinge.c +++ b/drivers/iio/position/hid-sensor-custom-intel-hinge.c @@ -263,13 +263,14 @@ static int hinge_parse_report(struct platform_device = *pdev, /* Function to initialize the processing for usage id */ static int hid_hinge_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); struct hinge_state *st; struct iio_dev *indio_dev; int ret; int i; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(*st)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; =20 @@ -287,12 +288,12 @@ static int hid_hinge_probe(struct platform_device *pd= ev) hinge_sensitivity_addresses, ARRAY_SIZE(hinge_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } =20 indio_dev->num_channels =3D ARRAY_SIZE(hinge_channels); - indio_dev->channels =3D devm_kmemdup(&pdev->dev, hinge_channels, + indio_dev->channels =3D devm_kmemdup(dev, hinge_channels, sizeof(hinge_channels), GFP_KERNEL); if (!indio_dev->channels) return -ENOMEM; @@ -301,7 +302,7 @@ static int hid_hinge_probe(struct platform_device *pdev) (struct iio_chan_spec *)indio_dev->channels, hsdev->usage, st); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -313,7 +314,7 @@ static int hid_hinge_probe(struct platform_device *pdev) ret =3D hid_sensor_setup_trigger(indio_dev, indio_dev->name, &st->common_attributes); if (ret < 0) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -322,13 +323,13 @@ static int hid_hinge_probe(struct platform_device *pd= ev) st->callbacks.pdev =3D pdev; ret =3D sensor_hub_register_callback(hsdev, hsdev->usage, &st->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1 From nobody Sat Jul 25 02:41:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56E5E3D6CCA; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; cv=none; b=Wcehz0Z52cnt3wXdg9h438GNH5eZMBFIzX39C6i2lLn3tiC8Uec+6jF/LGjRh5XD6v4Y09pw4a/xIhupT7s/XOW5f6npyV6/S9/Hkkzet57fMGwstFXopEg3DDnVMdqvWDR2F3fWZZ6SVN/693JX3VvMNpTIMUF91dnkxVQ62XY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540426; c=relaxed/simple; bh=DWsr9PTPwYYSUNvHLOJuCWKBPTXPLLa+QAvB/+nc7I4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DaSMSBMHlR6IKOQxKZg1KRn9Si7hRJ9voQ7I1MPoXVtkuDYugTkEB4EbY81B5MaWkgfKW03iWhcVZ+21XmYbXcdQh4jGjrEQXnAE8WTGM2tRarE/S1RQ+wMk71TyArP9zwjqDK2MBMjeBv923mjMLGI5RfxvpvFhrlc+wAFyDg0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cRuGjJjx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cRuGjJjx" Received: by smtp.kernel.org (Postfix) with ESMTPS id 389F6C2BCFD; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1784540426; bh=DWsr9PTPwYYSUNvHLOJuCWKBPTXPLLa+QAvB/+nc7I4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=cRuGjJjxA4JZxz0MGRso1bY/PKFbj0EUSFF9IzmgWBigdpd/LGY2KPq4E8Zf3v7w9 UVeDev9kjsjbbZGSnAbhK7oTQY1RUOULynZa00twUMWMXdFZq48IEZRjqP36Q3Vzfm 4l+QJu8kQg3M7YfeiHLp+O8lb0Kg/BX9NY+HRtD5cBHcRVg77QvAzqCpTnvIp7YED8 O9qiPEYb8h64j8e8Te3V8uzoXQ1ABSZLB/iYk7T9cBeMZx3OAWmBUuUnit8IzYfd9D 7C7rWGBbH2anfsHw4tEOegVX+jAW6DFnMuyj22nIFs9mELvbcyjKv5Zp2VAwJ4Yxca oYUITcBX0Crxg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27CEFC44527; Mon, 20 Jul 2026 09:40:26 +0000 (UTC) From: Sanjay Chitroda via B4 Relay Date: Mon, 20 Jul 2026 15:10:22 +0530 Subject: [PATCH 10/10] iio: pressure: hid-sensor-press: use local struct device 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: <20260720-hid-iio-local-struct-device-v1-10-74496fee6327@gmail.com> References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> In-Reply-To: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> To: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784540423; l=3124; i=sanjayembeddedse@gmail.com; s=20260702; h=from:subject:message-id; bh=KprakpDFPiwIPtA12YpCnWpXHOfCF0716+NW98RCOhE=; b=mbh6hvgT9+rdmxJAM7i6ZzhwW0uWhPEsY2qlpJRuZk5H5A2g9/mwOrgF4jjVli0KhtGFMDejv rnm20xClbDSCLTLM6gNtNHecByJDjUsgamb2JohWEbDuU2CfRcaUwOU X-Developer-Key: i=sanjayembeddedse@gmail.com; a=ed25519; pk=PcneEFtkmY+Ldl+KmOTpB/Q/HDsqko6Fb0/Z/5cuycI= X-Endpoint-Received: by B4 Relay for sanjayembeddedse@gmail.com/20260702 with auth_id=848 X-Original-From: Sanjay Chitroda Reply-To: sanjayembeddedse@gmail.com From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- drivers/iio/pressure/hid-sensor-press.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure= /hid-sensor-press.c index e688b0776547..fee170aa4379 100644 --- a/drivers/iio/pressure/hid-sensor-press.c +++ b/drivers/iio/pressure/hid-sensor-press.c @@ -230,13 +230,14 @@ static int press_parse_report(struct platform_device = *pdev, /* Function to initialize the processing for usage id */ static int hid_press_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); + struct device *dev =3D &pdev->dev; + struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(dev); int ret =3D 0; static const char *name =3D "press"; struct iio_dev *indio_dev; struct press_state *press_state; =20 - indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(struct press_state= )); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(struct press_state)); if (!indio_dev) return -ENOMEM; platform_set_drvdata(pdev, indio_dev); @@ -251,14 +252,14 @@ static int hid_press_probe(struct platform_device *pd= ev) press_sensitivity_addresses, ARRAY_SIZE(press_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } =20 - indio_dev->channels =3D devm_kmemdup(&pdev->dev, press_channels, + indio_dev->channels =3D devm_kmemdup(dev, press_channels, sizeof(press_channels), GFP_KERNEL); if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + dev_err(dev, "failed to duplicate channels\n"); return -ENOMEM; } =20 @@ -266,7 +267,7 @@ static int hid_press_probe(struct platform_device *pdev) (struct iio_chan_spec *)indio_dev->channels, HID_USAGE_SENSOR_PRESSURE, press_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } =20 @@ -281,7 +282,7 @@ static int hid_press_probe(struct platform_device *pdev) ret =3D hid_sensor_setup_trigger(indio_dev, name, &press_state->common_attributes); if (ret) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } =20 @@ -291,13 +292,13 @@ static int hid_press_probe(struct platform_device *pd= ev) ret =3D sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_PRESSURE, &press_state->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } =20 ret =3D iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } =20 --=20 2.34.1