Re: [PATCH v3 7/9] iio: humidity: hid-sensor-humidity: use common device for devres

From: Andy Shevchenko

Date: Sun May 10 2026 - 02:43:09 EST


On Sat, May 09, 2026 at 03:40:38PM +0530, Sanjay Chitroda wrote:

> 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.

This patch sounds like a required fix and has to be placed in the beginning of
the series along with the Fixes tag.

--
With Best Regards,
Andy Shevchenko