From mboxrd@z Thu Jan 1 00:00:00 1970 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 0075B31DD97 for ; Sun, 24 May 2026 19:26:19 +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=1779650781; cv=none; b=Xeoedq3FtOrTSfwdgZ/Cs1LeFQqGJ4aJ7MIJG44ukEiYOruD53smHtJ+Bc6nHenHcGFRad5r38q46fdwqdlB+6/rvbRBwpLqJ+AiIvxul1u24btA8uSNdrQ+hwMvd7lDW3/A5So1ov+ivMm4bcN1o+5x1hkc7/Qozw16Av4gmeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779650781; c=relaxed/simple; bh=q4tOcUeGyv4Ycx5bkEpJspcNlwbcOl19qkE2OSQ5/50=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=BO1mOj7NIE+ml6u9NxV/zpyJhkwzy1ubZ8mUxxpMAxR8QGFjmY3ZeN1hzpI8/Jay0b329Jwc4MlGausLOuTtrPBtEwQTfw5oTB2tGgrSSAUWUiKC26L78dr941OOGNFWN8CQKO6qZqFdnqRLdVdY/bzWcnug8XeQVL8gk/9+4uY= 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=pdrHJXw1; 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="pdrHJXw1" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2baef9f5ecdso73813295ad.1 for ; Sun, 24 May 2026 12:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779650779; x=1780255579; 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=Uh0Q7WJkWoaGQDocOyq50C2W+hagsuG+lujH441v4Ls=; b=pdrHJXw1g8uGrxR+9mQPp26ExwpNYWgcvDrqr62+BsgrjQGb/GNCY2/ExkPSG8UcxP M8eNOiD83jE1mPmJeRix0wZpQyRKX2b6NdrZTepck9s8CoOrGoeFgp0uwKckm58uyzZ1 +LtsZ44Y799sy5FDDnU0mUKuEiqbkRPJWu6hhIW616SQBNuqeMyK4+Dlq80QxPQzPEvp 2zPXkNa/UQurQK2DeqC/EkdMB7ww574DWGjKg+iPB2/4hSDXjqTAWBqHBu/O6ZDnfRcF zFuupRkS5SbgaHgLOrxsQdZKRcqCu9BzmkQR42G8FthkdG21eHMG4+59UNiihR0M2EmL eN6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779650779; x=1780255579; 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=Uh0Q7WJkWoaGQDocOyq50C2W+hagsuG+lujH441v4Ls=; b=jTdckuxnmv0n0/7imycVGnS80AdLN1cfN4ibSNsKLkbuIjA/zF4QSvSUhLLkA6tn0H e723adxKfFoyQw8UnsBFCtJ5V+5PK/MGrMZR7ioFYNzL8Y9goCvjcDm8SR64fZiTsBN7 nsL8cZncp2F1er739sxKFoxf7wmVQVm6lsVSqtofkqHtCUdqzrq3oI0oVuJ07xzYoKDS DQlggBocKYpDuhVIBHMRWPyVHw7AT+kM2o6KAaNT0ysduOysxDKEkBXhwgCYMtuljO4M gYTGwenX9HXM4p6yuurtSKrVVHhOFUn0LSF1hO3rG/sjcC5zSutWpgTscgqhhyqZ7MWE 49yw== X-Forwarded-Encrypted: i=1; AFNElJ8AAbdinOnSWebPZTcqAYUs8xMOEHREYd6a+RFMVkp5rXfHUBBpxImRSU/lhS7cdGqYARsNpXud2hNdnSk=@vger.kernel.org X-Gm-Message-State: AOJu0Ywk1vKAk/vkYD8aGqRGq7MkCpSQbdA5p1ac5X5tgu+Oq4E5haIy h5ajyUozU2iME+jgSvV3qzzliNSp70cvgH0E2ss0g9HBJltrxkCcXtN8 X-Gm-Gg: Acq92OGEi5XCv2vwQecHRsiMatZIQzAEAPNWq6mYxE7NpaHGud63Nffv/ThDqU2tPX/ e7L8+hsBBVEkLNawrHaVE9S07a8EBItVQe4HnLr1UYcgxxpBdg0CbY31Tk3WpsducXjWTh+tGjJ UUfsYSbiT5340CDCKqxfwVWty1eItnjMHr0u/QAAmYtzdfzqldO/bBEyPlTLqVdpj8dwoG2PQLR 9TkG4XHmMfu5vltNSOh6pDNHs2QBj/W8Kr0dRpmM+f6Lp0LIvRGYDUT9me1Kii5PTK/ETN63MbC MzJP99ynOXObLlyjEP48dvv1QvK8pMYl6pQCqb2pQAPA14kQr24LZgII737xLTRKE+b7MmAfyF3 PyNUgu4xqhLVvw2bvwiGz3WAXZlaOGusAfYriB/AFcq0aANsXYksAscckbO/NqTj1nsPs7a/St7 lD2yqiJ4APi93K5O8wWDEI2XvQrONem0eg5Ol+a//rmliOTnLbt1nx134eaLU= X-Received: by 2002:a17:903:2f4e:b0:2bd:2051:13ed with SMTP id d9443c01a7336-2beb06fcbfcmr130007635ad.23.1779650779499; Sun, 24 May 2026 12:26:19 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bed2061c59sm16394465ad.2.2026.05.24.12.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2026 12:26:18 -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 v4 14/36] iio: temperature: hid-sensor-temperature: use common device for devres Date: Mon, 25 May 2026 00:55:51 +0530 Message-Id: <20260524192556.1195042-5-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260524192556.1195042-1-sanjayembedded@gmail.com> References: <20260524192556.1195042-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: 8bit 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/temperature/hid-sensor-temperature.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/temperature/hid-sensor-temperature.c b/drivers/iio/temperature/hid-sensor-temperature.c index 9f628a8e5cfb..31ebfd1a1fe2 100644 --- a/drivers/iio/temperature/hid-sensor-temperature.c +++ b/drivers/iio/temperature/hid-sensor-temperature.c @@ -213,8 +213,8 @@ static int hid_temperature_probe(struct platform_device *pdev) if (ret) return ret; - temp_chans = devm_kmemdup(&indio_dev->dev, temperature_channels, - sizeof(temperature_channels), GFP_KERNEL); + temp_chans = devm_kmemdup(&pdev->dev, temperature_channels, + sizeof(temperature_channels), GFP_KERNEL); if (!temp_chans) return -ENOMEM; -- 2.34.1