From nobody Sat Jun 13 06:00:17 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.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 125E83A0E93 for ; Sat, 9 May 2026 10:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321453; cv=none; b=Wgxwzx8NI4HRSxGiQvkRPkReJ01W97aHLGBl50YQqG5w4lFCRyz9UMgzApG5gYJKc1IAYyx7Znwzh2MyMts4Ybr7KRSQFkksBYc9fnFcpvDsYHOk5ETRC208FhEIUThp5qWHXcHbReUPcSh2EZP+itwgUGLCkAXT2AZoB+cVmPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321453; c=relaxed/simple; bh=qxh9mNsgMQ/xB4BxyREkiTMPAocgmkD2LnOzKtz8rgQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CiHkG8AkerdLVSFV69kmyYukRLlUN0PO/FD+epVO0iTLBhB6T74CXIfcIwFyg7TsMApq1XdJrO8bpl+lzUgRjg6LU008pOT1q/agoACuR0gAwzMTftrT4yfClBTXZF+4Oi1lnfc9BRlccxbpoxVbx/Nbq7krTYQpnj2JH690HQ0= 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=LDxVQZEp; arc=none smtp.client-ip=209.85.214.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="LDxVQZEp" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2b788a98557so21029545ad.2 for ; Sat, 09 May 2026 03:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321451; x=1778926251; 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=h+/TwTgUKwpqbt6bnwp+kW260JQF+yfn7VRp15dRTeM=; b=LDxVQZEp7e57qhOgSLcHc/Fl3qjwOGKIZ9DLU2roC6xAjZlTcBQcJuKYwHziUrosBt Jk95LT1DSL0YeKGL43goVAP3b1KxQ4T5RZyoYK3x3UYznDs3erd+tuFO7+bSETK2HmCN 1XMl/geYNRpQBr/mnUR/3YtNx3gsDtREkHpQzxOZDcLVvBjPabKWmbXlkn/HCZF7xZw1 6ZcHrmzlGh/OnPDpQxhvjsI+3MeWiGwJNBGEbprMHPiKr4bJmjoYssfOWpQWF+FrTpC8 Ly81iQBLpJMM3alVP2pAkMePUGp3UQQNKVuEqJ4PVY2WNAk0Weg9ulAjaWPspnvKQrVD eI2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321451; x=1778926251; 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=h+/TwTgUKwpqbt6bnwp+kW260JQF+yfn7VRp15dRTeM=; b=iD7RAahZw0FXeoQu/xN92jlUUj4OsaH82rAjfjB7M6MU60yjmeg5ce4Zzd0K9k8nv3 2kUmL61fdhsTmm7wZW+LGSTLJPoOWegIj3Aa+7pGzv5HlBBXS5dq6MFgLkCqaIuIjSLK YL7cDTgcapeAxYqWiVtp3Vt9i+K3O74+yAbwKhjVVbM5Es6RxP90YgQjLm2QJg/zLP9u 5LxXT4jNm/aSxa2pbByp2t796cDBBrxpZ419zf90vrW3bueHPHVIhKt79J1h4Oov4qi5 CeFByitcgHLww5wc4pEmcXyJz3E7uzSgBVo7CJ8K1wEAlyjh3kCqA6oaEofcRRiorDwd Dx9A== X-Forwarded-Encrypted: i=1; AFNElJ9ZGrKxufpCvFSVhkcO165B+ULkLYCGMJjeq1tOTEooIBeDgAy1HFSKxrl8bCLsyIegE1Memgs293mk7kc=@vger.kernel.org X-Gm-Message-State: AOJu0YyiPRQK3uN6wTaAe5qTSUq5m5JheelM5wb5bh2FMbaBfVlyRhvq Dvo5GuRMdz2uL9tZpYX2Zg5/lBCqr5gRIocGDeEBr0mVJdDa7vxNgw7p X-Gm-Gg: Acq92OHg7QwaLEhoZvVwU48CU2++187DI/ryQQLJ0aukIE3Sy2BKjAla79eonAE36TL iNxxYGzOx12z8t1BNyRK4tEoI22byWCPRmzZy7k4Ul8CldehTEKDdqvR1DACicYRH9umQxbQxbf zp2iczng1xmRf/Bn++So7XVx4XNcq0borEhmw7z+qONb+XxKsIeWwSizImhNoXZI5VH17xSnJkh T6OeELJAkQfXcO+l7e0Q11MD30qCRRaf3tQIIYe/ssnc9FDiXX6dd+yhWrJfMYDdN8hz+x4E+BM IdKnZ+zvf+Ok7erY2rKQkmT5X2utvI+3OSQwluMEBKQQvZHZv5+GRTd1APtAt0zO5L2/MF/opBZ NdaFVCSbSrDmMdjuPQqsR/V+hiHOr+TmtvtmCFsv50g2BoS8wFkSzCejacAaxqx90qzI1e+/7RD xolUOFKWoQv4WrFb0YxpcdSVvemj/qQWfrgzgkOe6Q9yezmYTi X-Received: by 2002:a17:903:2d2:b0:2b9:4941:7f6e with SMTP id d9443c01a7336-2baf0cf399emr67752045ad.2.1778321451176; Sat, 09 May 2026 03:10:51 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:10:50 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/9] iio: hid-sensors: drop redundant iio_dev argument Date: Sat, 9 May 2026 15:40:32 +0530 Message-Id: <20260509101040.791404-2-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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 hid_sensor_remove_trigger() uses struct hid_sensor_common to release resources acquired during trigger setup. Earlier implementations required struct iio_dev to clean up buffers, but with the current code this argument is no longer used and is redundant. Adapt to hid_sensor_remove_trigger() API change across all HID IIO drivers to match updated prototype. Removing it simplifies the API and is a preparatory step toward converting the trigger handling to a devm-based API. Signed-off-by: Sanjay Chitroda Acked-by: Srinivas Pandruvada --- drivers/iio/accel/hid-sensor-accel-3d.c | 4 ++-- drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 3 +-- drivers/iio/common/hid-sensors/hid-sensor-trigger.h | 3 +-- drivers/iio/gyro/hid-sensor-gyro-3d.c | 4 ++-- drivers/iio/humidity/hid-sensor-humidity.c | 4 ++-- drivers/iio/light/hid-sensor-als.c | 4 ++-- drivers/iio/light/hid-sensor-prox.c | 4 ++-- drivers/iio/magnetometer/hid-sensor-magn-3d.c | 4 ++-- drivers/iio/orientation/hid-sensor-incl-3d.c | 4 ++-- drivers/iio/orientation/hid-sensor-rotation.c | 4 ++-- drivers/iio/position/hid-sensor-custom-intel-hinge.c | 4 ++-- drivers/iio/pressure/hid-sensor-press.c | 4 ++-- drivers/iio/temperature/hid-sensor-temperature.c | 4 ++-- 13 files changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hi= d-sensor-accel-3d.c index 2ff591b3458f..a63dae90dadc 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c @@ -416,7 +416,7 @@ static int hid_accel_3d_probe(struct platform_device *p= dev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &accel_state->common_attributes); + hid_sensor_remove_trigger(&accel_state->common_attributes); return ret; } =20 @@ -429,7 +429,7 @@ static void hid_accel_3d_remove(struct platform_device = *pdev) =20 sensor_hub_remove_callback(hsdev, hsdev->usage); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &accel_state->common_attributes); + hid_sensor_remove_trigger(&accel_state->common_attributes); } =20 static const struct platform_device_id hid_accel_3d_ids[] =3D { diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/= iio/common/hid-sensors/hid-sensor-trigger.c index 417c4ab8c1b2..28d050b45c74 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c @@ -218,8 +218,7 @@ static const struct iio_buffer_setup_ops hid_sensor_buf= fer_ops =3D { .predisable =3D buffer_predisable, }; =20 -void hid_sensor_remove_trigger(struct iio_dev *indio_dev, - struct hid_sensor_common *attrb) +void hid_sensor_remove_trigger(struct hid_sensor_common *attrb) { if (atomic_read(&attrb->runtime_pm_enable)) pm_runtime_disable(&attrb->pdev->dev); diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h b/drivers/= iio/common/hid-sensors/hid-sensor-trigger.h index f94fca4f1edf..afec46ecbe71 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.h @@ -16,8 +16,7 @@ extern const struct dev_pm_ops hid_sensor_pm_ops; =20 int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, struct hid_sensor_common *attrb); -void hid_sensor_remove_trigger(struct iio_dev *indio_dev, - struct hid_sensor_common *attrb); +void hid_sensor_remove_trigger(struct hid_sensor_common *attrb); int hid_sensor_power_state(struct hid_sensor_common *st, bool state); =20 #endif diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-s= ensor-gyro-3d.c index c340cc899a7c..fe663b19e902 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c @@ -354,7 +354,7 @@ static int hid_gyro_3d_probe(struct platform_device *pd= ev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &gyro_state->common_attributes); + hid_sensor_remove_trigger(&gyro_state->common_attributes); return ret; } =20 @@ -367,7 +367,7 @@ static void hid_gyro_3d_remove(struct platform_device *= pdev) =20 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_GYRO_3D); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &gyro_state->common_attributes); + hid_sensor_remove_trigger(&gyro_state->common_attributes); } =20 static const struct platform_device_id hid_gyro_3d_ids[] =3D { diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humid= ity/hid-sensor-humidity.c index be2338d5f407..e580a2af9562 100644 --- a/drivers/iio/humidity/hid-sensor-humidity.c +++ b/drivers/iio/humidity/hid-sensor-humidity.c @@ -255,7 +255,7 @@ static int hid_humidity_probe(struct platform_device *p= dev) error_remove_callback: sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &humid_st->common_attributes); + hid_sensor_remove_trigger(&humid_st->common_attributes); return ret; } =20 @@ -268,7 +268,7 @@ static void hid_humidity_remove(struct platform_device = *pdev) =20 iio_device_unregister(indio_dev); sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY); - hid_sensor_remove_trigger(indio_dev, &humid_st->common_attributes); + hid_sensor_remove_trigger(&humid_st->common_attributes); } =20 static const struct platform_device_id hid_humidity_ids[] =3D { diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sen= sor-als.c index 384572844162..9b57cdced18a 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c @@ -432,7 +432,7 @@ static int hid_als_probe(struct platform_device *pdev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &als_state->common_attributes); + hid_sensor_remove_trigger(&als_state->common_attributes); return ret; } =20 @@ -445,7 +445,7 @@ static void hid_als_remove(struct platform_device *pdev) =20 sensor_hub_remove_callback(hsdev, hsdev->usage); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &als_state->common_attributes); + hid_sensor_remove_trigger(&als_state->common_attributes); } =20 static const struct platform_device_id hid_als_ids[] =3D { diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-se= nsor-prox.c index efa904a70d0e..473c45626487 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -340,7 +340,7 @@ static int hid_prox_probe(struct platform_device *pdev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &prox_state->common_attributes); + hid_sensor_remove_trigger(&prox_state->common_attributes); return ret; } =20 @@ -353,7 +353,7 @@ static void hid_prox_remove(struct platform_device *pde= v) =20 sensor_hub_remove_callback(hsdev, hsdev->usage); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &prox_state->common_attributes); + hid_sensor_remove_trigger(&prox_state->common_attributes); } =20 static const struct platform_device_id hid_prox_ids[] =3D { diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/ma= gnetometer/hid-sensor-magn-3d.c index b01dd53eb100..8be3dfe4dd58 100644 --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c @@ -542,7 +542,7 @@ static int hid_magn_3d_probe(struct platform_device *pd= ev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &magn_state->magn_flux_attributes); + hid_sensor_remove_trigger(&magn_state->magn_flux_attributes); return ret; } =20 @@ -555,7 +555,7 @@ static void hid_magn_3d_remove(struct platform_device *= pdev) =20 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &magn_state->magn_flux_attributes); + hid_sensor_remove_trigger(&magn_state->magn_flux_attributes); } =20 static const struct platform_device_id hid_magn_3d_ids[] =3D { diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/ori= entation/hid-sensor-incl-3d.c index 4e23a598a3fb..56fd9c53dfc2 100644 --- a/drivers/iio/orientation/hid-sensor-incl-3d.c +++ b/drivers/iio/orientation/hid-sensor-incl-3d.c @@ -378,7 +378,7 @@ static int hid_incl_3d_probe(struct platform_device *pd= ev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &incl_state->common_attributes); + hid_sensor_remove_trigger(&incl_state->common_attributes); return ret; } =20 @@ -391,7 +391,7 @@ static void hid_incl_3d_remove(struct platform_device *= pdev) =20 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_INCLINOMETER_3D); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &incl_state->common_attributes); + hid_sensor_remove_trigger(&incl_state->common_attributes); } =20 static const struct platform_device_id hid_incl_3d_ids[] =3D { diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/or= ientation/hid-sensor-rotation.c index 4a11e4555099..56fdb3412fe3 100644 --- a/drivers/iio/orientation/hid-sensor-rotation.c +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -353,7 +353,7 @@ static int hid_dev_rot_probe(struct platform_device *pd= ev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &rot_state->common_attributes); + hid_sensor_remove_trigger(&rot_state->common_attributes); return ret; } =20 @@ -366,7 +366,7 @@ static void hid_dev_rot_remove(struct platform_device *= pdev) =20 sensor_hub_remove_callback(hsdev, hsdev->usage); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &rot_state->common_attributes); + hid_sensor_remove_trigger(&rot_state->common_attributes); } =20 static const struct platform_device_id hid_dev_rot_ids[] =3D { diff --git a/drivers/iio/position/hid-sensor-custom-intel-hinge.c b/drivers= /iio/position/hid-sensor-custom-intel-hinge.c index a26d391661fd..5288b63f4e21 100644 --- a/drivers/iio/position/hid-sensor-custom-intel-hinge.c +++ b/drivers/iio/position/hid-sensor-custom-intel-hinge.c @@ -337,7 +337,7 @@ static int hid_hinge_probe(struct platform_device *pdev) error_remove_callback: sensor_hub_remove_callback(hsdev, hsdev->usage); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &st->common_attributes); + hid_sensor_remove_trigger(&st->common_attributes); return ret; } =20 @@ -350,7 +350,7 @@ static void hid_hinge_remove(struct platform_device *pd= ev) =20 iio_device_unregister(indio_dev); sensor_hub_remove_callback(hsdev, hsdev->usage); - hid_sensor_remove_trigger(indio_dev, &st->common_attributes); + hid_sensor_remove_trigger(&st->common_attributes); } =20 static const struct platform_device_id hid_hinge_ids[] =3D { diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure= /hid-sensor-press.c index 5f1d6abda3e4..2bf5d055e175 100644 --- a/drivers/iio/pressure/hid-sensor-press.c +++ b/drivers/iio/pressure/hid-sensor-press.c @@ -319,7 +319,7 @@ static int hid_press_probe(struct platform_device *pdev) error_iio_unreg: iio_device_unregister(indio_dev); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &press_state->common_attributes); + hid_sensor_remove_trigger(&press_state->common_attributes); return ret; } =20 @@ -332,7 +332,7 @@ static void hid_press_remove(struct platform_device *pd= ev) =20 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_PRESSURE); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(indio_dev, &press_state->common_attributes); + hid_sensor_remove_trigger(&press_state->common_attributes); } =20 static const struct platform_device_id hid_press_ids[] =3D { diff --git a/drivers/iio/temperature/hid-sensor-temperature.c b/drivers/iio= /temperature/hid-sensor-temperature.c index 9f628a8e5cfb..60d4fcc8043b 100644 --- a/drivers/iio/temperature/hid-sensor-temperature.c +++ b/drivers/iio/temperature/hid-sensor-temperature.c @@ -253,7 +253,7 @@ static int hid_temperature_probe(struct platform_device= *pdev) error_remove_callback: sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE); error_remove_trigger: - hid_sensor_remove_trigger(indio_dev, &temp_st->common_attributes); + hid_sensor_remove_trigger(&temp_st->common_attributes); return ret; } =20 @@ -265,7 +265,7 @@ static void hid_temperature_remove(struct platform_devi= ce *pdev) struct temperature_state *temp_st =3D iio_priv(indio_dev); =20 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE); - hid_sensor_remove_trigger(indio_dev, &temp_st->common_attributes); + hid_sensor_remove_trigger(&temp_st->common_attributes); } =20 static const struct platform_device_id hid_temperature_ids[] =3D { --=20 2.34.1 From nobody Sat Jun 13 06:00:17 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 E957439E164 for ; Sat, 9 May 2026 10:10:55 +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=1778321457; cv=none; b=k8EJvryq29bOaaDmU+CCHEup46+uQcT58wkaSdqT+ddUOdbFI/PYmp7wH5A1G3jvSHa+wG2QoK9V+Z7qPJOOCmL/E3yFSkliB879uHQ3ygXuaPq/yX+hyV7VEvngWPLFq0eLwKP/ZF5djeq3seLDe7wkBGnjdOXZq7lu1/lCaZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321457; c=relaxed/simple; bh=tPWcv1jECZQQd9JlDny4sLxfDxzU2UCtd4V+vUCcfMg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pJrMF1dV7Ctt80T4gvyIDqzKIDijQkWq9Imq9ajpadA2bkNOSLPAk1R2VJywISchC6a4VNZYiwp18eEbdFiBraXmlLHA40zm5KPL+qsxC6f21E1dHaHfCAuXupqkeIPzFn5jqMqeAIPj+kcpFHSPvuxMHVaQuEV3R7MqQ8kXB2g= 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=i8+SXQpx; 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="i8+SXQpx" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-c80167f5716so1188801a12.2 for ; Sat, 09 May 2026 03:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321455; x=1778926255; 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=JkFhHabJLImjsw5jAKHOTDz0VLKOY6FhmBrPls4dhd8=; b=i8+SXQpx1PKKFWK0+os+QQWDUi3jJ5RYXDE2fYqwC1lEo05WfTF23/yyXn+t/Lv5v3 IQAa9be8g6velieS5mf/DgjiLo89UvH9AIE00+gQirsz7k8VGmfV8RBNlWRG17IN1EWj k8IFvz99LNtT9ZvdSGbk8XwJcs6QYAf5TUIrI+BcWIgfrraMPQmiz3NbNW8jl3HbFcKf l8LfvhrlkD8SBCU6h6qMETYI1cnm7MIRGqa2z5On8sy88dv9NW4WSeMLqAZpVFs+f8zo wl3+HGXXBjV71xVICP986VyI/7t5ioHJK9bOSfbtJFtH7Aioq+drpvavLvFZ88DF5dAW mScw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321455; x=1778926255; 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=JkFhHabJLImjsw5jAKHOTDz0VLKOY6FhmBrPls4dhd8=; b=eQ6t/TB5h8BbA7ivLmJRI6lg0xNf8KzEKYvQUmH7pl3KHSNBzuo82KbHK0M5yBl102 9cvP8Xfg6iFxEk27LNI7z9ZyDBnRueOD52VzQaF422tplZtCUNUgBzRMSI5POSnKDO1J PjOj3Ukk3DDB78nYWozEGW5SnR2e2z7rz2i+Oi1gD6vM2b8z8Gg8ZDgOVZuJHDbXWSc5 pJ1EaRjDfHNUFRxc1EMK8qmZPO5+8DG3o8Hvm6bdS7KuN4UPbf17z052MxM3YnZbiGCq ShSY3Atz2s/+bdFzHABKmsC3vOqc1xYy7XtaynhRyPi/cT1twkM1o8Rd7sOGox1fvE/W GIFw== X-Forwarded-Encrypted: i=1; AFNElJ+6DNBs1/mp4id22Re8+C6D5hNs7GII9+XNYsWiY+mjMyra7M0XMlB0EJ6L2xaZ8NoMkVa1lQA6zBUaeCY=@vger.kernel.org X-Gm-Message-State: AOJu0YxSVLh3W1ehTUgUh24W9A+FDr478as7pywGqdMYc/Vd1u3rHJp0 pSDtAgdsgqGhU5jt706UFhJx/lzgb9w1lT5Dl7iVM4JPaj8KGG7GtXrE X-Gm-Gg: Acq92OEg9uXAA1O4SS3YJUuUZ8/t2OsPMgTRxi7CCMZKGWfVkUebJ9H0tzxb6f0Bxbs Ng2icbVrqrWYzxuOSmw69KP1c3U8kwgP1tsTquZtBfb6RghO+m+os/yQh9iQVb5qxsslhFQAXDT Dnj1kLuzAMUjcFvWx71T0caxDKmzmbbVuvZuZO0/soq1B4eFKl1lVYpRQskEPXzy20sO1OAFul5 M7y1AHdfxyIalIfVusykBgHSCMAg+3QxTvjqGar0GSEaoGIcQ8Z5JKNDb3XGcqKBuoUb61G016B bPseYWI46wpTyTjCEnKfbJpiUcEFypBWOxt8m7Hiu0kam8lbnKTITKosL4mp37PwrA8L1hOhbie vkuFc/FbYvyeISiHQ2D04uBmU3yVW7Eo+hNeB/wWNEGdwRMagnRyXpaC2z1Baac++Wot64O0NvW AU+Gtwdu1oe3Ce4PwnSiucSWUYT6NIkMRNjxqIBCK3xkINkgft X-Received: by 2002:a17:903:1ab0:b0:2b2:a267:784a with SMTP id d9443c01a7336-2bc7aa20417mr19618195ad.24.1778321455274; Sat, 09 May 2026 03:10:55 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:10:54 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/9] iio: hid-sensors: cleanup codestyle warning Date: Sat, 9 May 2026 15:40:33 +0530 Message-Id: <20260509101040.791404-3-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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/common/hid-sensors/hid-sensor-trigger.c WARNING: Missing a blank line after declarations Signed-off-by: Sanjay Chitroda Acked-by: Srinivas Pandruvada --- drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/= iio/common/hid-sensors/hid-sensor-trigger.c index 28d050b45c74..98fadc61a68a 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c @@ -313,7 +313,9 @@ static int __maybe_unused hid_sensor_resume(struct devi= ce *dev) { struct iio_dev *indio_dev =3D dev_get_drvdata(dev); struct hid_sensor_common *attrb =3D iio_device_get_drvdata(indio_dev); + schedule_work(&attrb->work); + return 0; } =20 @@ -321,6 +323,7 @@ static int __maybe_unused hid_sensor_runtime_resume(str= uct device *dev) { struct iio_dev *indio_dev =3D dev_get_drvdata(dev); struct hid_sensor_common *attrb =3D iio_device_get_drvdata(indio_dev); + return _hid_sensor_power_state(attrb, true); } =20 --=20 2.34.1 From nobody Sat Jun 13 06:00:17 2026 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.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 2D29139E164 for ; Sat, 9 May 2026 10:10:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321461; cv=none; b=QLpcUANSdq0bCUaKy7rehNffesZ+eY6RdCLB94OpFi6S/irLE9DKjrRfSa4GnCmNWzePq/+zRCN3belS8olzVwSwsWiWoNUl8NsXdHUqAxvGthA0GrRApwpCbUO6lN5uQy1ExI3l+KdFJSKU2EqlvBIIgyP4aKGkfN6tr5UKFMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321461; c=relaxed/simple; bh=fDDowIRabahRP7ZRMJkG11Sb9EjOwHHgjbqpVpODPyA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SDawpz7g2ZrrItbGfM8VseTel97B4RW6juOhiVcycSxwg77VF4AePFbX5ygAUGI4WU8eJ4JOplqyQcoIqVhvSrRf5TAAp0Y/xN0dUxOWMXhfS0Yne9V2bBSbKluS1LBRnrmNvNH0QjAd2Zk+O40OsGgxA3N47fUlZTSYrxipPFQ= 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=MORvAHNY; arc=none smtp.client-ip=209.85.214.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="MORvAHNY" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2bc763e2ba8so2094585ad.3 for ; Sat, 09 May 2026 03:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321459; x=1778926259; 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=ABvgg+B1vj+fw2JrPeoeBLI2umPERJ7N6KddlE6yxNo=; b=MORvAHNYKmhv4Ki0BPUS/doKVEdmQ2vjBYaI83x/DrW2jFtBvWXvsgIQNrzomvVQLQ K9024TMLQW/QE0W1AtYbOuZx7AXzcHFUOwbo1kkpBmvchu2MFjAatyFXaxMqswTeBnde gTp4QHdGQ2Nxn3OaC5V10lR6aUEQ2WnrHhod9xpnhYTMCgIUNxFVCEGJmYIKhWKIR2PT h4FV3RRMTkSdEyxsbP6Cm/enNyl/RLoiJF41QTtzeRrEZbV7H47bB6YukW7upOZbubBj aZ9x5A73zESlSFnzOu1SRntaRbpkFpbPj3CjgCqC7P2n9WVuWJB4vyKGCVGi2yP8Qbg7 kFtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321459; x=1778926259; 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=ABvgg+B1vj+fw2JrPeoeBLI2umPERJ7N6KddlE6yxNo=; b=XUFuD9o8tn80i7Lo/LRwDXxshHmenVA0YqUwPxlNt7H5W6+PaYoVdjJBb6NdSUeLBk zrmAoF5kwz7f/t8LmMP5djRrDROddkJ30e2JygV5A67mw8v/uGp0EJT6YbDA0ELlK53I lAn0P4NTHCMgDm5t3mCnsLAKcrQ9vvLiSNqw4pauvIWnlfZkwVwehLoFFEGyTFvgaFGN kihKI3TAWfl1apoEN3rup/0lDNZUvOvgmyOep7daEkdrOA9AyEuDk9B8zUEHkXPtIGjr uG/fxVtnorfui1XVmCgC4Gi5b8lvzQ/UHuoYcOBbJZe0wZVPh8lk1gzXqL9N0+fk0emU iO5A== X-Forwarded-Encrypted: i=1; AFNElJ9BuLWTxbWIJOhQZcuIPSPq9dBUa8EwC7GMNayAnG2/n/UlJe3gwdSgdJvNFHz1iw9/ZDSQgwXXoLerhiE=@vger.kernel.org X-Gm-Message-State: AOJu0YwfknWZfjr1gkjUPJ+eGdU1aReqhWbjWBOZ5rS+6yJY05DjoOq5 dkxBn+b1EHv1pYU6BAXDlBZVm+OHxz+64f5PrfgX4h2WkMUrnnXzSuQz X-Gm-Gg: Acq92OEE7LbU6BYqzQYZpuFjAhpHUaRjPNAI+izwRl6AeC9lI7xfWxcRLk5Pq9h/8QP DVDErGb8bryp8h4nk5l+tgllTM+w8Xb7CubjvT3NXRhEniO5FKd0j7We2CLvDK7CCkciZWToQan zIRT922ilOdKn8PdXp5IgXv+/d2M0Rahq5K0lvYtoMQLg1GSx3jLgP6W8c+9ZCL/fGf5PKDZfhK ZhjL50k1sIQ7DITRt6Sw6RDvCiX4lM00CHP1AXUIv2s3lY8JcTivmFE2HkTMBZT2uH6inL2tcxa zlQmJsIKGRU65U9w8toHgNJBd/vPE72QSQMK83YvWRU7S+2urwwS50uVQUjy8kM+ueKcNdMR8sX dlZ8BGHEf/cU0Nh9Xv/hP7mR6Hwr3lxTAwKsl2cakO5VUYoOs01QukpBJX/cFPi84MuP/gynbB1 E6xG/rLmiYNvEUlamDhcG2C/Y4JUrGskKqHIaGej8j8RbsjToZq2ZfnEP7TqhZBqIAPXZViw== X-Received: by 2002:a17:902:db12:b0:2b4:5cea:f619 with SMTP id d9443c01a7336-2ba79c10b84mr178754585ad.22.1778321459383; Sat, 09 May 2026 03:10:59 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:10:59 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/9] iio: hid-sensors: introduce device managed API Date: Sat, 9 May 2026 15:40:34 +0530 Message-Id: <20260509101040.791404-4-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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 hid_sensor_setup_trigger() is common API used for the HID IIO drivers, prepare devm API devm_hid_sensor_setup_trigger() to acquire resource during setup and release using device managed framework during drivers fail, unbind or remove path. Register action with devm_add_action_or_reset() to release resource with devres framework. Signed-off-by: Sanjay Chitroda --- Changes in v3: - Remove cast and update function based on review comment from Andy - v2 link -> https://lore.kernel.org/all/20260429175918.2541914-3-sanjayemb= edded@gmail.com/ --- .../common/hid-sensors/hid-sensor-trigger.c | 18 ++++++++++++++++++ .../common/hid-sensors/hid-sensor-trigger.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/= iio/common/hid-sensors/hid-sensor-trigger.c index 98fadc61a68a..fb6a4587ae03 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c @@ -301,6 +301,24 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev= , const char *name, } EXPORT_SYMBOL_NS(hid_sensor_setup_trigger, "IIO_HID"); =20 +static void hid_sensor_remove_trigger_action(void *attrb) +{ + hid_sensor_remove_trigger(attrb); +} + +int devm_hid_sensor_setup_trigger(struct device *dev, struct iio_dev *indi= o_dev, + const char *name, struct hid_sensor_common *attrb) +{ + int ret; + + ret =3D hid_sensor_setup_trigger(indio_dev, name, attrb); + if (ret) + return ret; + + return devm_add_action_or_reset(dev, hid_sensor_remove_trigger_action, at= trb); +} +EXPORT_SYMBOL_NS(devm_hid_sensor_setup_trigger, "IIO_HID"); + static int __maybe_unused hid_sensor_suspend(struct device *dev) { struct iio_dev *indio_dev =3D dev_get_drvdata(dev); diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h b/drivers/= iio/common/hid-sensors/hid-sensor-trigger.h index afec46ecbe71..6fd7c39a240d 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.h @@ -17,6 +17,8 @@ extern const struct dev_pm_ops hid_sensor_pm_ops; int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, struct hid_sensor_common *attrb); void hid_sensor_remove_trigger(struct hid_sensor_common *attrb); +int devm_hid_sensor_setup_trigger(struct device *dev, struct iio_dev *indi= o_dev, + const char *name, struct hid_sensor_common *attrb); int hid_sensor_power_state(struct hid_sensor_common *st, bool state); =20 #endif --=20 2.34.1 From nobody Sat Jun 13 06:00:17 2026 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (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 3292939E6EB for ; Sat, 9 May 2026 10:11:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321465; cv=none; b=myE6GPObhFS7JeuZJkBcp+NjrF5KeVNZISoEc59Y80WdGFGXxkcAdFMCe35G8Go/ZsDfi/c3Dz1nvl5oMGmRM4+7urjVzDwkeGhO976wvDZTicbFdwOki7n/btRCSLDhHHBhL+5dgIZSvWscTOgcdznugOKenPvP0yVtRu2EznM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321465; c=relaxed/simple; bh=fePoKQCdmGQ5iCsHGCBYd3YJit6qtCw4gWlQYUfsjL8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ryL/TboVRCaGFbtGpx1ZZCXfi0NW/OFYWeIHFow18EuRxM2bxAHFgEgFMqEgHB+zXg+lV06ZxAxuPasFPSAZD0zXEhIAEK2y9NaewSZHqyOCmMseVKZ26A44unYFVZpE3kul6k23KM4yEPCac0L1+4Cj+a+tEhSFAOQwbV4dkDM= 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=HJmqrtHU; arc=none smtp.client-ip=209.85.216.52 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="HJmqrtHU" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-366330b6751so1619209a91.1 for ; Sat, 09 May 2026 03:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321463; x=1778926263; 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=cOHJqaTcF1+fILni7WOWN2idwKhjTJof5YlmSEOsQy0=; b=HJmqrtHUT98sbXStBPPsJRo+/iuIgJRV+dV7ta3ywwzsORubxNeGsOooEU3Ad+dmDn /05+i/rCkhYzxu9P40O7iyjXN2q++/ZfN5uWkSHOh0TJhY+NKJ6K0KWYpzhbok03QWgc ks4fFaOozG2vkxoB27FXOKqT+hlhSKCLsxXkxcNaeyfBpJcz6b+FAW9HMnBVsOMTFH2C 0SD4OOzX4qg6jiKUeAHpwid4BhtrLXBzKzO+bwjh219E5OG0W6yzcbUiEh4YiFRGFzlB WIwVcJD5xb1+D96dgPKx9ooKTzRnQyu9tbkAKOngpeKo8aR0aY6ywV8nScaA3McGnEAw g1NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321463; x=1778926263; 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=cOHJqaTcF1+fILni7WOWN2idwKhjTJof5YlmSEOsQy0=; b=VIXj6SMvaN0OkTt2/WnzlbibDrOq+bghZge2GO2ljNUVQKUCrI9I2axeXQuvrUxP0d LcQrYTwKtBR7RCAdUKzvy8XCppLNYDAaASr2sYM/d+d3647fI0L4MWXDinVdEZttTX90 d1sNofWFwZLWikkR3DlaQIFu+TFqqQlUSNh/y5mZ2S9WaCzjWcNsqRlt6/HPO5w06H1I UCN4ecXQSALkxBpmsB9WT1eOb6BQVxdtTLsP8iDthNfwDmXYPmfCVztWENomyWfp+Ho/ mOWqwLF29xpVBWnRSWr9QUexIZIhpELfAs1/NZIwyEAhqA6ZM8ckBH455+/ircOJ4LcJ yLWw== X-Forwarded-Encrypted: i=1; AFNElJ+CZe3kxWgytAfEl8JxACL7A6WuP8prjpBOKUU4QwkLktJ2XaMmlJ49kE8H6c66PhLGVjJA7Y8PNb7wCsA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+/swcHctjpZCqHf5m/PraWQIyTfArH6/1D8rv/DGd5FwqRCSl CFrTIlAMKqm8hMsUD+jdhj+rqF5EpJiJYa3qqutxXR4fXtfMRilBqH3b X-Gm-Gg: Acq92OFuv0toVVnAnNaQ+yxeLIDW43KpC4/mBE5nmU7Dd5fYlVx00UBxBrR34xfN8Wq hgsqpRVpjAkXqGvWs+UtnlZ/eivn9KdhKeFwuTeJjbtEx+2edCqNORAwNzUN027EXXKbfzR+mO+ Wjd6NYml9V8JBZRrnlr1VEgxJFjJMm7AWqvLPOLjO9I1D40WULYE/RaE3Wjz50Ow/JJTJHKA0M5 J1/B24PN8oGrunLCyryMgplxb9UYX6gp1RUa0Yol1M91VNdKOpyPu9gw6mIFLNBrdZJ7DINmdzy zdV72NE6vRmOlv9rWL0lmlMKuerBplAueOyRpVxA0WP7Jd6QuF1Bod636T08SJAKyRqgvO9wPXE rXwXUKszMExPw0Ltm1be8uWIPW4KCnrFlbz4p8vIa/YrDMqHYlhHWhNiJkld638jqh4+S+jbesz WHd7Fw/Y/bF++VJ9DdFE6g0kdJ48Yr/NahzgFyYQFte8LC0pFZNNBQJkBe/P0= X-Received: by 2002:a17:903:1b50:b0:2b2:42da:25c4 with SMTP id d9443c01a7336-2ba794bf96emr162194595ad.14.1778321463470; Sat, 09 May 2026 03:11:03 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:11:03 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/9] iio: gyro: hid-sensor-gyro-3d: cleanup codestyle warning Date: Sat, 9 May 2026 15:40:35 +0530 Message-Id: <20260509101040.791404-5-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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/gyro/hid-sensor-gyro-3d.c WARNING: Prefer 'unsigned int' to bare use of 'unsigned' + unsigned usage_id, Signed-off-by: Sanjay Chitroda --- drivers/iio/gyro/hid-sensor-gyro-3d.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-s= ensor-gyro-3d.c index fe663b19e902..87537f9c58fb 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c @@ -187,7 +187,7 @@ static const struct iio_info gyro_3d_info =3D { =20 /* Callback handler to send event after all samples are received and captu= red */ static int gyro_3d_proc_event(struct hid_sensor_hub_device *hsdev, - unsigned usage_id, + unsigned int usage_id, void *priv) { struct iio_dev *indio_dev =3D platform_get_drvdata(priv); @@ -209,7 +209,7 @@ static int gyro_3d_proc_event(struct hid_sensor_hub_dev= ice *hsdev, =20 /* Capture samples in local storage */ static int gyro_3d_capture_sample(struct hid_sensor_hub_device *hsdev, - unsigned usage_id, + unsigned int usage_id, size_t raw_len, char *raw_data, void *priv) { @@ -244,7 +244,7 @@ static int gyro_3d_capture_sample(struct hid_sensor_hub= _device *hsdev, static int gyro_3d_parse_report(struct platform_device *pdev, struct hid_sensor_hub_device *hsdev, struct iio_chan_spec *channels, - unsigned usage_id, + unsigned int usage_id, struct gyro_3d_state *st) { int ret; --=20 2.34.1 From nobody Sat Jun 13 06:00:17 2026 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.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 414393A0E80 for ; Sat, 9 May 2026 10:11:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321469; cv=none; b=hi0goHPUdTFaA3vNO12IhlB0gUJ4VCV6AplRY9YcwxiHYVYxgMXClPFXr3yaIfrK9dtdwGlX6gECKUFRtX3qdpmFxsxKaJaPgq3xmlV8r2fYQdAJIlc8F0f1CE+EHMyLxCh0B0n/Eq5uj6fXqZoKwtnCQ7qPJMmWu11T6pEN9TE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321469; c=relaxed/simple; bh=OXbE0hHG264Jq5RuBE0XlsR247e4tE58gxyxm5gN62M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bcF3b5GiRzdMlnsZm9ebTr2aGa54SAUprCJkz+ASAhAKn8MD7q0CT8EKh2RCCenBCUedZJlKKJn2usjgR28UwLcuGHiODwyMR5I2XibFJHCuwG4AGGjv/20g4eFTZqSzlQeFjhEcmv5N0dWOQ91nKq1IHCgMzdpno04IY6UrHgU= 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=RUygEjOI; arc=none smtp.client-ip=209.85.214.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="RUygEjOI" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2bc763e2ba8so2094955ad.3 for ; Sat, 09 May 2026 03:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321468; x=1778926268; 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=9EOX8xMuI5acwbxKOg+QC2TTMrkRYYm6GWsY8rfp+3c=; b=RUygEjOI5CWh4K5d7GTulc+D/7vP0cIsNNe/HMo248buNJIM3UBm6oPG/bamQxvibS maAIxwaqQOPWy1ztrLC6fnIEfLHZ9ZbQKNTyEev+ZnSkEcW0wrhdk4G1VMwoAigiYseE iY6PwXhDvlNF17vGy6bl0QGNhkoHf/ImUGHQwIRL/wflV78fPdlodxK0NrCB2BIIHa1f mw98U6Tlb9f05OdE5fAjnyAILwFn9ZUFoPJotDxu/Zvx5cyNDJY/hdO+PYgoHaCYbvV3 17AGRJazsdzfylyDcCdtEMiAhygJ/xbSmJGnuZiKtLrEFP7fz5OXw523M75JVgpq/mgm WSgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321468; x=1778926268; 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=9EOX8xMuI5acwbxKOg+QC2TTMrkRYYm6GWsY8rfp+3c=; b=sE5KKAqky4C/C6dbTr2T6SMEDN72qMu40eq8ZGmy/MyrNmOMb+oMmpfdSnaR6uNtSy hllaXCgKiWWH92fEo/sQVI9DPPq/wHlw/XhLcqcOcX4fEYv9L41/71rD4yukLJPAdeMO W8ihLexBLLupb+XGFlN1J1WJ89fzSaxWxYO/yESjSqPl3kxH6nmg/f3AUeeRjG7qubs9 LiQXnpoGAvkVIDma/eyBhQf0K6MrRMMITjZoW4KfttjWdYOY7K+Ay3HYqDZkhSJQH3gJ Gys/CldYzdLQO0iKwGyQ3NIuUtUMtNvY+qL/xRJbcm1ieG6Jzel0DlO03B0Fjiaed/Vf AZQw== X-Forwarded-Encrypted: i=1; AFNElJ8PYdxPoovY/V2K3HQMk02GR+qu3h0lkifYtzqH6ejnA8Mjq4MDIYsWBWKiJej5kJxxBPXnxLUTwA86LxQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+0KHt9jJ1Mml2UCSsJYOxn5d8Ddmn70e8/H8Cij1SqWtC0ZlB 4Z40CdSWtJdeES/cV/JWUDQYwPZg7RiOxAD1VaGuyRLUBSrG98Sni5+qc4AE7g== X-Gm-Gg: Acq92OEbzQha+waazjRYjq+Hv0YF7CrarpgmoW4dIissRHZbhzeVR5kkjEvyFm83JWt Ms3AbrrICzGbz+vsR4Bv7FLSkX0BHPgOBBFTAbigMbLnz2DCOAVTiSirH+pSaKRlT9wR8hBUa4L 4J0WE37Z1PD06hnxqaKNwOQ9q7YpIw0T0EnCu/ryE1TpAmcKw3UWcbMiSWb7H1/1jDtgQ2wkOdl 402n8KSRQ7brgNQI4Su4QavWydiVs9XmuqBPp5iMgEMYRQ6ZwCpHBm0L6KKvSjwcMM107iYxQGx OppEzPgBaJwyVjLCz+tJ220TN95ZI6L8JbA8xWJyo/x5Ko3+3+nuZoqb1J6dzOZSkBakxRB+5/n pWMxPFeS4ky39caajSg7MQev+E/6J61qIqW9S+EC1OHyVyljSNm3UlFWfYb2rtvqS1ZuDF3ScoR Q/Qi4ELb5lp/6yECT2bX/feMc+CP4K+I1Oikxu0T85kJEnvke6 X-Received: by 2002:a17:902:8b84:b0:2b4:6d92:b002 with SMTP id d9443c01a7336-2ba7a343404mr117379655ad.37.1778321467655; Sat, 09 May 2026 03:11:07 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:11:07 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/9] iio: gyro: hid-sensor-gyro-3d: drop hid_sensor_remove_trigger() using devm API Date: Sat, 9 May 2026 15:40:36 +0530 Message-Id: <20260509101040.791404-6-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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 devm_hid_sensor_setup_trigger() to automatically release resource during fail, unbind or removal of driver using devres framework. This simplify the setup, remove goto, avoid manual resource cleanup in teardown path. Signed-off-by: Sanjay Chitroda --- drivers/iio/gyro/hid-sensor-gyro-3d.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-s= ensor-gyro-3d.c index 87537f9c58fb..72e7db8ce3b2 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c @@ -326,8 +326,8 @@ static int hid_gyro_3d_probe(struct platform_device *pd= ev) =20 atomic_set(&gyro_state->common_attributes.data_ready, 0); =20 - ret =3D hid_sensor_setup_trigger(indio_dev, name, - &gyro_state->common_attributes); + ret =3D devm_hid_sensor_setup_trigger(&pdev->dev, indio_dev, name, + &gyro_state->common_attributes); if (ret < 0) { dev_err(&pdev->dev, "trigger setup failed\n"); return ret; @@ -336,7 +336,7 @@ static int hid_gyro_3d_probe(struct platform_device *pd= ev) ret =3D iio_device_register(indio_dev); if (ret) { dev_err(&pdev->dev, "device register failed\n"); - goto error_remove_trigger; + return ret; } =20 gyro_state->callbacks.send_event =3D gyro_3d_proc_event; @@ -353,8 +353,6 @@ static int hid_gyro_3d_probe(struct platform_device *pd= ev) =20 error_iio_unreg: iio_device_unregister(indio_dev); -error_remove_trigger: - hid_sensor_remove_trigger(&gyro_state->common_attributes); return ret; } =20 @@ -363,11 +361,9 @@ static void hid_gyro_3d_remove(struct platform_device = *pdev) { struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); struct iio_dev *indio_dev =3D platform_get_drvdata(pdev); - struct gyro_3d_state *gyro_state =3D iio_priv(indio_dev); =20 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_GYRO_3D); iio_device_unregister(indio_dev); - hid_sensor_remove_trigger(&gyro_state->common_attributes); } =20 static const struct platform_device_id hid_gyro_3d_ids[] =3D { --=20 2.34.1 From nobody Sat Jun 13 06:00:17 2026 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 8591E3A0B3B for ; Sat, 9 May 2026 10:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321473; cv=none; b=THTIpEDo3XWR+7Vn7Idb88A5PdtxBoUfVxKjocAX9/0yOvoM5GJc19Ij7EJHGcx3OwoFxt80VeMJs/qwdDt/vrw3mA2e9KgPVFYiq81SK3cg4I7t9ChGcqppHci9iAU+vFsi2mjvFr24HS+BG8VICGgbMIcC8FLzrxm7V6tHqfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321473; c=relaxed/simple; bh=q+dOw9JIxaH4UadvQHCm3a9EV/WB+WLCsK+NOBMLDn4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sTzVJ7YVO/okC8CiWU7xLPkPqA33/An7ScscS2Kr5ByBSihvWpYQiI+zQ3iwfHZKTFWBAqvOxE9UH7Xl28+yp3G06USx6F6f4gV1JbkJrZAVBPWWmgPuhkdVdm4JRQJdcFeri1OVmPQNomXTL9LCUG9S/Q/Orky0vjqPXjX5xNE= 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=oOi22OTR; arc=none smtp.client-ip=209.85.214.172 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="oOi22OTR" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2b9705613ddso18025845ad.1 for ; Sat, 09 May 2026 03:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321472; x=1778926272; 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=QZy8osW6ZxoFBcwJGDv5RLWlWq8U4K/6eriZ633rrUU=; b=oOi22OTRulSOhM/5Mir17nGm10LCJ8shftEm2EErlf8TfhdiaDKMrcbH52w/hBCzTl WPZmflndNfWlEAoa2xubUeWQ7qDqWtyGiXyw5i46ZIaBk8oL2YSCsCCP6AYpzLz7m9i7 DAKuhPZQXqsaty6wxPZhwewn9snpeGhXa4++7LRCENzMB7UUDu+ecy+bIF1xLuHVQY4I V3Hkjrvy2aH4MW5GqHAT8KK0k0FCXBTH0MUt4XdOFZZ0Yy+1hYQvp/ol+cfR8h+3LZVS fNg+HbFIq46zyOB30raOygEkKUS5LKzZHISrHBryLDc/ut7q/IS1NP0+kDfowNKEK2SF Uxvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321472; x=1778926272; 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=QZy8osW6ZxoFBcwJGDv5RLWlWq8U4K/6eriZ633rrUU=; b=HVpn34BCh9flGQsEM1Svs7VEJF2A9YUwRMitd0RNt8Map0qMJMdn2MZF8+7uXRho7w wbPvpD3eoUP53c2ZtcO4uia41xaz6voyg3DHBhF4F146kkqn0xfCKSPp3bAupYS4nuGu ykCotg5f8mH4q+KSuzaKjyIrcurpvUeQX4++ugGmlfrlUzimXWzB5YxEOMuc/gUFDlo8 6OJAmKHKtOSjneUvTeKO0sPwhlsdakgCMWeRVf4cxuK0LY57zhNa0V1hESX8emXsTecD l3crNZolVoo+etpARkxFecW4ZTwpY+CABOQJqsKFWh9IAVpuoqSVEYExILNsWFMdzTXv 8T2g== X-Forwarded-Encrypted: i=1; AFNElJ8WKodw9JqvTOqjXkOo47q2uKeRpt6S8VOa/ZBIb8kXTBq8u6dy8+f3yyocR5Y51HEdQGRWzl1z2EHFhys=@vger.kernel.org X-Gm-Message-State: AOJu0YwtKfXMKdBcGEFWgndvA7Udj2f6POtLPySnWySTz2McC8y9l23E XC2gmN8KwAinvO8yZS77Jx/OS5B4sNVgvV4nBhWjdxF8DD32WuiQhQSz X-Gm-Gg: Acq92OG4s/xWYuFo8NAeVbrJpABEyQky9X+/0IPEJdoJW3Y5gGd+JW68SdHqlerxadw nf2if18cd1a5NC99QU757xuiCPUhQ+JDAOdIKtTll8mYECOp0oV8d2gjg5PbVPwW1etIpsS75rl 6k4Y3wZ5gt0FS+YIopASX26vAcLh3ivEwj78uKFfG0xGxNhfBbKNM5Zr7mx2iPusCVw5RJ2s8Uq ru/kK95PAH+10ZDDUZZt5dhKfFGL0XF/gKi96glAwrZeupPrEwmSo0qXx0lCjgezwauQPfRBqkw tgqoV79lxYXdYj0eIyiLm3rD3i/uYq+zBo8I7SIfI8F7Z4AzNr6UUazNBIuzmYjMONIxfXMbVGP 1F45LXpotFi7Vt/d40h6QaLFQUl/LuhhTBel8u6O+RPN5EfYbbWRPzAF9RP1gT76Q7oNeOVNlid qz1L1610yDjW6eIvCiPWndvhJXvLZjt/SRKpHhs0eJX60h86zh X-Received: by 2002:a17:903:845:b0:2ba:bfc:76a8 with SMTP id d9443c01a7336-2ba79290621mr119308095ad.16.1778321471744; Sat, 09 May 2026 03:11:11 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:11:11 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/9] iio: humidity: hid-sensor-humidity: cleanup codestyle check Date: Sat, 9 May 2026 15:40:37 +0530 Message-Id: <20260509101040.791404-7-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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/humidity/hid-sensor-humidity.c CHECK: Alignment should match open parenthesis Signed-off-by: Sanjay Chitroda --- drivers/iio/humidity/hid-sensor-humidity.c | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humid= ity/hid-sensor-humidity.c index e580a2af9562..968dd8d4bb35 100644 --- a/drivers/iio/humidity/hid-sensor-humidity.c +++ b/drivers/iio/humidity/hid-sensor-humidity.c @@ -45,7 +45,7 @@ static const struct iio_chan_spec humidity_channels[] =3D= { =20 /* Adjust channel real bits based on report descriptor */ static void humidity_adjust_channel_bit_mask(struct iio_chan_spec *channel= s, - int channel, int size) + int channel, int size) { channels[channel].scan_type.sign =3D 's'; /* Real storage bits will change based on the report desc. */ @@ -55,8 +55,8 @@ static void humidity_adjust_channel_bit_mask(struct iio_c= han_spec *channels, } =20 static int humidity_read_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 hid_humidity_state *humid_st =3D iio_priv(indio_dev); =20 @@ -101,8 +101,8 @@ static int humidity_read_raw(struct iio_dev *indio_dev, } =20 static int humidity_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 hid_humidity_state *humid_st =3D iio_priv(indio_dev); =20 @@ -127,7 +127,7 @@ static const struct iio_info humidity_info =3D { =20 /* Callback handler to send event after all samples are received and captu= red */ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, - unsigned int usage_id, void *pdev) + unsigned int usage_id, void *pdev) { struct iio_dev *indio_dev =3D platform_get_drvdata(pdev); struct hid_humidity_state *humid_st =3D iio_priv(indio_dev); @@ -141,8 +141,8 @@ static int humidity_proc_event(struct hid_sensor_hub_de= vice *hsdev, =20 /* Capture samples in local storage */ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev, - unsigned int usage_id, size_t raw_len, - char *raw_data, void *pdev) + unsigned int usage_id, size_t raw_len, + char *raw_data, void *pdev) { struct iio_dev *indio_dev =3D platform_get_drvdata(pdev); struct hid_humidity_state *humid_st =3D iio_priv(indio_dev); @@ -159,17 +159,17 @@ static int humidity_capture_sample(struct hid_sensor_= hub_device *hsdev, =20 /* Parse report which is specific to an usage id */ static int humidity_parse_report(struct platform_device *pdev, - struct hid_sensor_hub_device *hsdev, - struct iio_chan_spec *channels, - unsigned int usage_id, - struct hid_humidity_state *st) + struct hid_sensor_hub_device *hsdev, + struct iio_chan_spec *channels, + unsigned int usage_id, + struct hid_humidity_state *st) { int ret; =20 ret =3D sensor_hub_input_get_attribute_info(hsdev, HID_INPUT_REPORT, - usage_id, - HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY, - &st->humidity_attr); + usage_id, + HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY, + &st->humidity_attr); if (ret < 0) return ret; =20 @@ -208,20 +208,20 @@ static int hid_humidity_probe(struct platform_device = *pdev) humid_st->common_attributes.pdev =3D pdev; =20 ret =3D hid_sensor_parse_common_attributes(hsdev, - HID_USAGE_SENSOR_HUMIDITY, - &humid_st->common_attributes, - humidity_sensitivity_addresses, - ARRAY_SIZE(humidity_sensitivity_addresses)); + HID_USAGE_SENSOR_HUMIDITY, + &humid_st->common_attributes, + humidity_sensitivity_addresses, + ARRAY_SIZE(humidity_sensitivity_addresses)); if (ret) return ret; =20 humid_chans =3D devm_kmemdup(&indio_dev->dev, humidity_channels, - sizeof(humidity_channels), GFP_KERNEL); + sizeof(humidity_channels), GFP_KERNEL); if (!humid_chans) return -ENOMEM; =20 ret =3D humidity_parse_report(pdev, hsdev, humid_chans, - HID_USAGE_SENSOR_HUMIDITY, humid_st); + HID_USAGE_SENSOR_HUMIDITY, humid_st); if (ret) return ret; =20 @@ -234,7 +234,7 @@ static int hid_humidity_probe(struct platform_device *p= dev) atomic_set(&humid_st->common_attributes.data_ready, 0); =20 ret =3D hid_sensor_setup_trigger(indio_dev, name, - &humid_st->common_attributes); + &humid_st->common_attributes); if (ret) return ret; =20 @@ -242,7 +242,7 @@ static int hid_humidity_probe(struct platform_device *p= dev) =20 humidity_callbacks.pdev =3D pdev; ret =3D sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY, - &humidity_callbacks); + &humidity_callbacks); if (ret) goto error_remove_trigger; =20 --=20 2.34.1 From nobody Sat Jun 13 06:00:17 2026 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 92FEF3A0E8D for ; Sat, 9 May 2026 10:11:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321478; cv=none; b=fymW3juo3UzF3R7aFTtZMuOPm6joiq/4ZiJgsK3mceJG7+eGFe3evKw0s0WAFuIBdzCu+UfV9vAVPAZUalnRoqjv/0+QegFOAvNBNCMPcN8BkgYJcSJHeVbWAiJzs0FLty5vnco03jE46UbdD1nRc39o0IRtJuhDDMQ//GnAGME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321478; c=relaxed/simple; bh=LtbznnOeojfg3MF3c0kn2sEZYBxwqCbnGZr2+LdXKgA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=sNIgZTABkUXSsAVdXY2CFmRKL7sod/Ck+vC1VxVEwzfzIjRXOYy7E2CkIh1oia2pW+ZSIuu/7Woad628sT3CUd2TWUo1ghrpdb/X/sJh6vuVv2KbWqHQIep8TGBGw3OtRCxFhGJ2PMAYF1r9zIwd5GYUfE+9Sf30N+EsVE9AeMU= 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=PWJj4cPt; arc=none smtp.client-ip=209.85.214.179 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="PWJj4cPt" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2ab46931cf1so27449205ad.0 for ; Sat, 09 May 2026 03:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321476; x=1778926276; 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=9NgiT1pTPWMdwN24wzoDVvqnzlpt6mLzp3Hj6Dzxk7k=; b=PWJj4cPtnAYtTjv8bKxjkSSBrE2A8SKHISF4Pyvl1FqeCH3FXeXsqg1BiuiuXl3+5Q 6xAsnrnEItgziwc3HWbriBK873d3rwRWFlJLGZD5zZE0TCvSeastG6cbVCDkh30vMGMr HlUWK2zPccW3t/sFitu7xXCTCK71gnFcc3VVaQ6ce6w7beyOBz0fzi+tecx4aV0Cdaao TC3kggF0bZWArlm3y964j2Fd0znIsumFXDZixpn7ykqKQryCaMq4dpLooplPMeR+QsHm 3S/cvDpFMqodcVR4DGaJQv7kSUQEvDxLh7j6Pph0s6LKOInSPMtA5lszjVZ6AwAZqGTn +Ciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321476; x=1778926276; 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=9NgiT1pTPWMdwN24wzoDVvqnzlpt6mLzp3Hj6Dzxk7k=; b=Hd9TN4x909LoZtFNnm1PwpeoXS4z72+3UKOFI27iAHkUuG5MLwtH5On6DgE5eHpsPR fSMFfOwbTAR44R1tXec9FRkQOMhWO0g4Z8FFsRwI8tvmceHSitj5qP2kga/3kJtyz+ID pSKyofzH1KcbyMYr5CbEhvFJtED8nqLtVG2lhWsSHq25CUhZgabOy3diNHp4kOTnCn1l xKFNT/VusP+nfzFxP+Prg+7NDLqRhlRIyRcqHvtLL/EbL5ULeKaAqS1kZlvIXhqizXUa 8RgOd10tr7ZGILQKYb9nos4UXJRRDCYgz13qPEEe7K9gOO/REYZmU3xZazDf4k6nFliF eyHg== X-Forwarded-Encrypted: i=1; AFNElJ84zAWtteQOnJBbtW++cfsQyup+VLKzMiwYL6kOlAV3/hy6vA3k5/a8epbUhJpjO6gWhnaz0zKv+rdqLD4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3492BYYbXO3n1NSs4LbD1v3DpmJCnTq9hdRXxN9gKbJC7bYpq ofj5y/Vx5StXPYEujEKwozEKT7eP1bk63MMS+H6yM0zKivPWsoCXOZtu X-Gm-Gg: Acq92OHmlf89E66K42ioxNk7AvG+ze7hkE0+GxGbksqmCycZv1sRMtcblb08vwG5pb4 Wjq6cjTLBu7jHcf9+ch/E6xMTIxxoL8ubY6tb04az9dZisqXozKCVaCWpPIIAazjAx03qUsGghF jiSwFq8/DAvWAkH29AB4kQrBEi3nEkdqqCMxyT9QYoxk/EQeWM8pasy7GaMr+rFBQmmI52jDlX2 ZG8oGN7kbdliDxECwqVrHutYNy3lTUUTODvO62fEGSTkkhAHRzFd1QoaKabhOTPG8+3PQR4+gUl ePcnsKmtpsSpN1SN7NFUxTqUxJ1ECaSqWoRpOlxoGK3yKbiv9Eb7VglWTcag7/AY+YkVoXJYMTk yincXgC9iJTXwir1DNefb5GDn+90PTUmvtQtRtnjaapQd8iVo1jnZO5D5tFpghUODHgNm6u6Ufw Ut82FOp3JicAqDbcVFvz5vI6pDsmE7IO8RE/Fx/9Y56wzDEaYM X-Received: by 2002:a17:903:1a23:b0:2b2:6fbf:ea2d with SMTP id d9443c01a7336-2babc864863mr96873325ad.7.1778321475843; Sat, 09 May 2026 03:11:15 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:11:15 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/9] iio: humidity: hid-sensor-humidity: use common device for devres Date: Sat, 9 May 2026 15:40:38 +0530 Message-Id: <20260509101040.791404-8-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Sanjay Chitroda kmemdup() is used for memory that is logically tied to the HID platform device, even though the driver binds into the IIO framework. Using &indio_dev->dev for devres allocations works functionally, but it results in two separate devres ownership trees=E2=80=94one for the HID platform device (pdev) and another for the IIO device (indio_dev). The devres framework is intended to have a single, well-defined parent device. Since the memory originates from HID sensor probing and is not IIO-specific, &pdev->dev is the correct and logical owner. Switch to using the platform device for devm_kmemdup() so that all resources are released deterministically and consistently. Signed-off-by: Sanjay Chitroda --- drivers/iio/humidity/hid-sensor-humidity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humid= ity/hid-sensor-humidity.c index 968dd8d4bb35..18d4e376376d 100644 --- a/drivers/iio/humidity/hid-sensor-humidity.c +++ b/drivers/iio/humidity/hid-sensor-humidity.c @@ -215,7 +215,7 @@ static int hid_humidity_probe(struct platform_device *p= dev) if (ret) return ret; =20 - humid_chans =3D devm_kmemdup(&indio_dev->dev, humidity_channels, + humid_chans =3D devm_kmemdup(&pdev->dev, humidity_channels, sizeof(humidity_channels), GFP_KERNEL); if (!humid_chans) return -ENOMEM; --=20 2.34.1 From nobody Sat Jun 13 06:00:17 2026 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 754863A1682 for ; Sat, 9 May 2026 10:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321483; cv=none; b=lNIen2ptgyUgUbxTFQ5Y6D4iAD/mEEjgaIu7Tpfx0KP6XZwxH6q9Nz8JOltqJ/r6iQnTbK1bKMc1whREHadDMQLRAIYXNEoevXvG2gaMwVvaL3Or6cls+dRwG5rM7z7KF8rO4Y378854MIQ4MfFq8uDbFJGFaiWr9tzOa4JPCDA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321483; c=relaxed/simple; bh=VVbBRaPqNz0NXDuh6RaAIZv6l4EoKGyZf9pCIvkbudw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FQPF65AwC6Fj3QERcWRdYHejw0fleoFm2iwgVm5fEvjznZcgu3kzT5+Yc1psLpf3x2MM8ps4KV1BFl+z4DDwVrWvHn4nyLKfKRE8i7UwzZ4pQWsDpbZapU8WF28QhRmJbQLaHPLrNVC3eKoaBiRJpse2Z31c3qXCdmmGnqiJAqo= 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=ZapTjrsD; arc=none smtp.client-ip=209.85.214.170 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="ZapTjrsD" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2bc763e2ba8so2095445ad.3 for ; Sat, 09 May 2026 03:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321480; x=1778926280; 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=gOWOLL+hb+19Lzkxv0p25XQnGbbiGbdMhzO7Q7xEcw8=; b=ZapTjrsDMGpXsHK31XNdtv5alGguGU5KzHo7JS/hwrG251F4O1ZjZooTfFDUAy4ZDq lLDnD/cshUVa5IO3o17lmwnwbl1A1tu/QxrCcSeFXt8oLLVEEoLNhvjBZ0uvDnHN4BXo dlTv+i26Y3EUfn7RM5tFc+5GySQ/kW+/qMUiXJiOFOwqXGXPnljeGLjtHC1QK4cSDNs4 MZLe0JEUznHzBtY3A50cHT4JyneD/S9+vo6D4MA0KZorumyi5qLV2/GW9DIwD24QZGyL JCYBraubpxjE68hxjg7araxEtI9lDq21gQ8EniUOvPsIaWPA6KX3fn5Y1aKgg1DTkO88 AwZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321480; x=1778926280; 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=gOWOLL+hb+19Lzkxv0p25XQnGbbiGbdMhzO7Q7xEcw8=; b=WrNkwizdQLsQIjmuUQNwlheK7aHYz/xt6gfPRKeuuvVWiXf1Ncboi7VytB+OtWoz7E BxRhr/9q7BbqUwDX4ARDJV3Bn6jOhJhGFplrDveos5UQZgn4UDZie2AvfRvV98TOY7Nl uZnEqUAIpHEBHXnJDRA7E6Yj99ve6Nqv147ttZ9np8l9t6x9FVCiszLlN0RJlA95OHRf kJCc9EApJ3rxOXDTxtTCm0myK5BkJQduregBdWjFDlDOHRLT22uRu3mMEt4wmAPgeI7V /85837NhqeFLHIbTaXjNRBSupZ1Jvf3lWrSYy1x/fm9peO0yQ24X7XxsE7EUjk58CLqx hIgw== X-Forwarded-Encrypted: i=1; AFNElJ8MgYtpE6Ro/Qs3tD5SpjigWXCsal6RxEVOURqAYmctMK3d0MIDVYmFrmIatSdhS8kI63cxfObo3+K2VK8=@vger.kernel.org X-Gm-Message-State: AOJu0YyU1r5myNZuTXApWRN1tJVjcdSYQ86YViMOWxLv8dea+fEHcw0W qJpVB4pNh0d2xqOelj6XditfmAIyu0xH/4hUmrvPgjt3laFdBUMjjomM X-Gm-Gg: Acq92OHzpFryuZPyWsSY13yGpCxC/VngpJMbWlS01OnhlbcoctK5KmkbPh2dGwgCLD/ i/U1b10fOLDzp2gsF/H6OD971FKMlM4S305iyJz4XGuZtqAP8Ajm3nuVEkVdtHmxaiwJzQDjxKr z5rhUQI06CPDlAyvA1gxYZKdHYUiQijGc57PRi3ClzXXtrjdfz/UhwWzJseXn0gtn+FIiookOr8 463LsO2bSnISw2bKn9Fw/m6mzm3ZwbQlkwdhhS8CTw5JaJn2C81+bEyWcYY84Fg51PSxbOiRsPd mfmyBquZ4Nyg+KADso8h2qwdvDiYKuQZeuEEzKDDcLjCl+Dd3LcxYx6O7K2yG5/xMsvtCHuSrev KY9Srte0fRhCuNJ3OSsst1MFglrdIlECDnLg1crt8LfpI1izhNgItPtAGJTtle0zkJLjpj/aA4W 65Ebbec5bSeEOoGHu1Fezm8KjFsBtPPV1RMrlsn66tFrH5RHtR X-Received: by 2002:a17:902:d2c7:b0:2ba:99a2:c44e with SMTP id d9443c01a7336-2ba99a2dcb2mr148253195ad.21.1778321479939; Sat, 09 May 2026 03:11:19 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:11:19 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 8/9] iio: humidity: hid-sensor-humidity: use local struct device Date: Sat, 9 May 2026 15:40:39 +0530 Message-Id: <20260509101040.791404-9-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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 &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 18d4e376376d..d310ec43a118 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 Jun 13 06:00:17 2026 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 B5427366567 for ; Sat, 9 May 2026 10:11:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321486; cv=none; b=DraOHhlgNBk8r+CrOXsNnMdzCnOVQmep86cwSHRHzhpqiVrqpf0HvgeCAimCN+oFI9qjjueA4VnOMtMkj8qn95JsxXRiIeAnsSzOMrGm60MjCbSIkce7/xLXGqgfmZyJCDkv9f0MzdbS5jBtp2Mb0sBS944Rfe3aeAmnnO9pOps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778321486; c=relaxed/simple; bh=/ypM8gwlCiAeCIMJp+GRH1JKDXxEaGiFEs725h5oIl8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qe7CYZGKg1TrpPenwoAJaru1OWT4Kex3DWRdorSt5jMrYQcd61jST0QUXKjkT/4vZuOSb+wBGQxkD2Yoha7spDBBSY06SFll/rY0yUS4lCUrsGuBAP25J+3/4kjpiYnnbF8AC5EHlIDcgsy3ODGXGd4wcMpkY2613rJhE4svyro= 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=ku0O9Kab; arc=none smtp.client-ip=209.85.214.171 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="ku0O9Kab" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2b4583f0a1aso18102165ad.3 for ; Sat, 09 May 2026 03:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778321484; x=1778926284; 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=YxEj5NvBAWz6r+Pm4CowXogfvDTiNULt7IFl/LWJs1M=; b=ku0O9KabwFNfEXhEDmk4E5umbV+EVBGQybz+RG5IRB961Bt/uhVCgb1iFurwzxqXwi 6rB8nxIzfp48jn7JCo0biv5sCJBHWHnbuCpKjzBn/0EPtEvlhXvdJQxlLLNC4s1oFx+q CvAbf8Ptv0yNSd8EggetIKklX4cZEuyh1dzc+iNvsDyOSqVe6/mtawIBCAD9PA1VBq7y MOxkPGntyzlCZB8YkHYl9Y1TC+K3WcKzxi/3OmvFGl7Wg338RbCkIQR5wbqNdGoTqBCr 05UpS/oh+ZzELhToE88oFwGuEbViqznxYZnXG0rKVznimYGljigIXNQ2wKFk9YysCEKG 2HSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778321484; x=1778926284; 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=YxEj5NvBAWz6r+Pm4CowXogfvDTiNULt7IFl/LWJs1M=; b=c9ml6WR/BzLXVRxw0QOTWHjwycGNBRHdGCRih0oDffoQbz1O7em+5iyBYeLnIj9Hrg 1VnLtzZ01e/TtGak4lBeYfpnU0Q3FGEEmJn8SxtO+qsdBj/AZy0l8yYAVS49kXZ5TGlG bcdK5z13m2Udx3gxpd3cb4XFnKyPC/THug6pGi4UGEsYCDI9j5SaROIUgEWH815Xz5+d nhGlI7cX3k5uJeNO7kEht8JeUyjL2msr5ImvEZfyDAYDtBpxTCb4edtZry1VjZ1RDQNW HvIC3EV+GqH6E5lraBH3lcH1I+5yTMf7tv8rEInN5TDrnEw2BwnbDFG560PNFBEn3hnk arhA== X-Forwarded-Encrypted: i=1; AFNElJ+0oAdUatuMw3eKGCH7xueHCmS2RuKKp9Riq96v1vwn09You5bPG2tupSrVbAgEHC4QzEK6JnKEUA6w39Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+ZlP8CVnyuZVPRaHrlyGmxfN4sjen3GjrocGc6wmQ/FE5LqeM n2nl+T3BttRSmp2znGC3TyAKbZr3M+BtF6uQ390IQ1wiz9gJjzRZf8yy X-Gm-Gg: Acq92OFDFyDI0+M3OkbsKBuaMTEEvapK6VIizmfhz3Zpur5JvuzaDqGa5F5ZCYX8EqJ +E/K2qotsHPLfxDg3WKLmAk7mDgwQJZrnz++4lQHN1X6DC4V7rPcJVHjMQZdyYRVEtJeC567tjB l0PxQsSz3wTzW4k1urLz4QftqOdLcZQM54LXlsHGs5gJPaqsZBQBZ1NlN5BflxIfba/gRqzjjnL fGXXo8cIcptLjRphfMeRuOIOjlslxjT9xB8EubJd4gzqyIFGATKXL8xyjd3Tp144H8nHDBXE2f1 NiWcH7WvfspuwPS/RlacKOZpwGwOiESMCM33R7OR42FxzThShtLvIyVsP25vXwQY7z/pKD0dTsr LTU1OCoqDvcEYcygXis+BIoQX2v8YKzYj88iBu0UWroCjfsJjoKTtTCrtxnWwWlGu4js7J5i1EK CgysQV282Qql/UkCl4iFX4xm3ixsn9kwLRO0HSnEh1QxpAvvGP X-Received: by 2002:a17:902:d588:b0:2b9:cd2d:6f13 with SMTP id d9443c01a7336-2bc7a9a62ccmr21182805ad.10.1778321484030; Sat, 09 May 2026 03:11:24 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e83084sm47335365ad.61.2026.05.09.03.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 03:11:23 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 9/9] iio: humidity: hid-sensor-humidity: drop hid_sensor_remove_trigger() using devm API Date: Sat, 9 May 2026 15:40:40 +0530 Message-Id: <20260509101040.791404-10-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260509101040.791404-1-sanjayembedded@gmail.com> References: <20260509101040.791404-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 devm_hid_sensor_setup_trigger() to automatically release resources during failure, unbind or removal of driver using devres framework. This is done in a way to simplify the setup, remove goto and avoid manual resource cleanup in teardown path. Signed-off-by: Sanjay Chitroda --- changes in v3: - Update commit message based on review comment from Andy - Based on discussion using parent device of HID platform driver used with devres framework for this driver - v2 link -> https://lore.kernel.org/all/20260429175918.2541914-5-sanjayemb= edded@gmail.com/ --- drivers/iio/humidity/hid-sensor-humidity.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humid= ity/hid-sensor-humidity.c index d310ec43a118..4d4282e4b6e4 100644 --- a/drivers/iio/humidity/hid-sensor-humidity.c +++ b/drivers/iio/humidity/hid-sensor-humidity.c @@ -234,8 +234,8 @@ static int hid_humidity_probe(struct platform_device *p= dev) =20 atomic_set(&humid_st->common_attributes.data_ready, 0); =20 - ret =3D hid_sensor_setup_trigger(indio_dev, name, - &humid_st->common_attributes); + ret =3D devm_hid_sensor_setup_trigger(dev, indio_dev, name, + &humid_st->common_attributes); if (ret) return ret; =20 @@ -245,7 +245,7 @@ static int hid_humidity_probe(struct platform_device *p= dev) ret =3D sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY, &humidity_callbacks); if (ret) - goto error_remove_trigger; + return ret; =20 ret =3D iio_device_register(indio_dev); if (ret) @@ -255,8 +255,6 @@ static int hid_humidity_probe(struct platform_device *p= dev) =20 error_remove_callback: sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY); -error_remove_trigger: - hid_sensor_remove_trigger(&humid_st->common_attributes); return ret; } =20 @@ -265,11 +263,9 @@ static void hid_humidity_remove(struct platform_device= *pdev) { struct hid_sensor_hub_device *hsdev =3D dev_get_platdata(&pdev->dev); struct iio_dev *indio_dev =3D platform_get_drvdata(pdev); - struct hid_humidity_state *humid_st =3D iio_priv(indio_dev); =20 iio_device_unregister(indio_dev); sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY); - hid_sensor_remove_trigger(&humid_st->common_attributes); } =20 static const struct platform_device_id hid_humidity_ids[] =3D { --=20 2.34.1