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 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: 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/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/humidity/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 *pdev) if (ret) return ret; - humid_chans = devm_kmemdup(&indio_dev->dev, humidity_channels, + humid_chans = devm_kmemdup(&pdev->dev, humidity_channels, sizeof(humidity_channels), GFP_KERNEL); if (!humid_chans) return -ENOMEM; -- 2.34.1