From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (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 420F843634A for ; Tue, 16 Jun 2026 10:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781605618; cv=none; b=FgmVEORzcYHatnWanKTi9qP9y6a7hOatS0EqmtzvAZ3wZvjeW1eMyEiQBQmz0nOtTUpCk+1uZ3ljzXAzqbmMC07V2vJImCulUCSX1vVOsJkUZLS9rqZA3up/qa7oiG/v1yp3+Kh8JeUkZOi2dB4y8pgaZ6XiqBjkdTDwDdTtgvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781605618; c=relaxed/simple; bh=wg26RhGdHDg01DgrTxebKBv2YHtcTfKpPmvV/wk8vk8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=en64w6ddHGFUqa7Z5nalxRgZsCJwlOhEwp0BI1WOaW3VH4HzN2Dc0HuP8rZpjaWuGk7N7KqUi4KmamqZKGGesrwbYRZ8HZVINl3XVYoXW46P9noonHlcatAmfvrbxNPk5u2lwJnQjEp8PveVfl1Gl2lYuY3UzG1TzgFbXgPO1QQ= 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=rUNeQJ4E; arc=none smtp.client-ip=209.85.216.50 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="rUNeQJ4E" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-372b4330deeso2813411a91.0 for ; Tue, 16 Jun 2026 03:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781605616; x=1782210416; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IIRwhAGV5hxx8Gm1XDKNLxqpI0J55iNfuPNL2PF+/hA=; b=rUNeQJ4E2zzSmhXaEwA5ardYldxggmukchHTM8UtLdSF1YFCrpbgYHvTsCh9QS+UKJ vRsI6LYFnBrgGWbI075rmEDjFfRnD/5rZFYPDkozzdfEF0dyNRCMAzGrqMpHwg1iIdh5 lIDeBOp2yOp276ISDeH53/QtcF4XfDfK+DKQUs4gCwyAjqvakggwrp2OUohZyN+1jjwN CgvC9ZjfSAiPMr20X9Cy59jznbg7Qmmg+dWbAZvNofzbZ359GnrwXRPIBaegMQuSXB1z AcsGr8REVqfDI20epe3DI0ig+c2Z+xSq3fJ3TGF50i+GnJ4WDrGKeAFfB4U+snu4RZq7 2UHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781605616; x=1782210416; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IIRwhAGV5hxx8Gm1XDKNLxqpI0J55iNfuPNL2PF+/hA=; b=LBNrdTNnrQIDEdR9xzJdhWGpklAqR4pejf5HBI4crAzhzEMLfAh0XuQHzLPKTeWpkO V5nZzxmqqRanRPNwRjeFdm9Ag4r2UXeKTt2KQQtcQoeefscQ5to4mOay6yqAZo/7zRgc 0LEJwPDM3bYqxAvuJRDQppXCepuZ1NXtmYvi9koCd1cPqRTToHjhsx/kJt2gqq3um3gw MsvhoYh8qmyb2ZtuEuM+49lf+iE8jqr9ai4ekfIyijk+5amDVfYAXvQ40C8abb6QqCdz M/arT7OGcic/DSoyZASSWH96/Fg+XPEuQ+PnYUO7auqn1JeNIBkMGxE36gQfm06b+S4m NONA== X-Forwarded-Encrypted: i=1; AFNElJ/ZRM2Yf+6X9jmboQ0L2HqAsE1Dz77SmYUDNw1AwSElxvU4A2S9J3L3GquGNEJj9QeRYNi64XQXaPXixtE=@vger.kernel.org X-Gm-Message-State: AOJu0YyMvcL0T+iOb8d7yq1RBE73bA1tErfEB/jIoz0sgz44jElliOLt oa4cKwKvEKZmvVDVcIZUvnM3leLFYEHGFJ6msZfKufzU8MTsJWX3xsyd X-Gm-Gg: Acq92OGfKgLw37D6N4Df3RT1+qRhRd55CAgJRVMLHqKKb3R4p3IFHPVuA5LEnZEHtVb 4ebmedxgdLRi+G4UtUn4H7/9P0lt1FHJjHljNS6A4BuRFG07Rxi8Ez71nmvSpegRHpVhu2zPVP/ knzivC9I5b9H0ZGA03GpQ3x6gjoPxsuKZjAqQ24Oow+ZExLRa+uMuGg46y4h16N1Y+Bx/sdsPND rSDA6dj1F/JovniFRnhZlHgMPn7TX3nUIu1FXalliiSvdo3rSUM5hf/Hq81KKTgVSUJscLKr8S7 a5Av+fgNF4thgEWS3OWC2upDs/2q1te8WCFsVwdV7u/LF6wEBzBDF+VaWcXVqyMjOC4U9yW7nPJ s03Y51PD410IL5WkkYfW5Hxd9fDiwaMM2T2KNwg96ylANWyp3kKuDjo2+7qNs3Q8r71JphlJICM pWpDcZfbiLrtSHBfEhIedAdjiNgTnLf9m1vIflwNAx9Uh71aSj X-Received: by 2002:a17:90b:1a8b:b0:36a:5d1f:7b6 with SMTP id 98e67ed59e1d1-37c2bc5d322mr14244142a91.2.1781605616572; Tue, 16 Jun 2026 03:26:56 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-379e88d546dsm8079269a91.2.2026.06.16.03.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2026 03:26:56 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda Date: Tue, 16 Jun 2026 15:56:11 +0530 Subject: [PATCH 06/11] iio: position: hid-sensor-custom-intel-hinge: use common device for devres 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: 8bit Message-Id: <20260616-15-jun-hid-iio-alignment-v1-6-0cd544286575@gmail.com> References: <20260616-15-jun-hid-iio-alignment-v1-0-0cd544286575@gmail.com> In-Reply-To: <20260616-15-jun-hid-iio-alignment-v1-0-0cd544286575@gmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Jiri Kosina , Srinivas Pandruvada Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Sanjay Chitroda X-Mailer: b4 0.15.2 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—one 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/position/hid-sensor-custom-intel-hinge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/position/hid-sensor-custom-intel-hinge.c b/drivers/iio/position/hid-sensor-custom-intel-hinge.c index a26d391661fd..0ba9d2d43913 100644 --- a/drivers/iio/position/hid-sensor-custom-intel-hinge.c +++ b/drivers/iio/position/hid-sensor-custom-intel-hinge.c @@ -292,7 +292,7 @@ static int hid_hinge_probe(struct platform_device *pdev) } indio_dev->num_channels = ARRAY_SIZE(hinge_channels); - indio_dev->channels = devm_kmemdup(&indio_dev->dev, hinge_channels, + indio_dev->channels = devm_kmemdup(&pdev->dev, hinge_channels, sizeof(hinge_channels), GFP_KERNEL); if (!indio_dev->channels) return -ENOMEM; -- 2.34.1