Re: [PATCH v2 3/5] iio: dac: ad5504: Align headers with IWYU principle
From: Taha Ed-Dafili
Date: Wed Mar 11 2026 - 06:28:38 EST
Hi Andy,
Thank you for the detailed review across the series.
> > #include <linux/device.h>
> Is this still being used directly.
Yes, it is still needed for `struct device` and `dev_get_platdata()`.
> > #include <linux/kernel.h>
> And what is this for?
You are right, this appears to be a leftover. I will double-check its
usage and drop it in v3 if it's no longer needed.
> The rest of the changes looks correct, but still missing headers:
> linux/kstrtox.h
>
> asm/byteorder.h
>
> Might be more.
Good catch on these. I will add <asm/byteorder.h> (for cpu_to_be16()) and
<linux/kstrtox.h>. I will also do another general pass over the includes
to better align with IWYU principles before sending v3.
Regarding the probe function (Patch 4):
I will split the `struct device *dev = &spi->dev;` refactoring into its
own preparatory patch. For the scale calculation, I will restore the
`-ENODEV` check to maintain ACPI compatibility, use `ARRAY_SIZE()`
(adding <linux/array_size.h>), validate the range array indices properly,
and drop the legacy `pdata` fallback.
I will include all of these fixes in v3.
Best regards,
Taha