[PATCH v5 4/8] iio: adc: at91_adc: convert to device_property_*() APIs

Joshua Crofts crofts at kernel.org
Mon Nov 23 00:02:21 PST 2026


On 23-Nov-26 8:00, Abdelnasser Hussein wrote:
> Use the firmware-agnostic device_property_*() helpers instead of the
> OF-specific property readers, so the driver does not depend on a device
> node being available in probe.
> 
> Update at91_adc_probe_dt_ts() to take a struct device and read its
> properties through device_property_read_u32() as well.  Since the helper
> no longer uses DT-specific APIs, rename it from at91_adc_probe_dt_ts() to
> at91_adc_probe_ts().  This removes the need for a struct device_node
> pointer in at91_adc_probe(); as a result, at91_adc_probe_ts() now logs
> against dev (&pdev->dev) instead of &idev->dev.
> 
> Drop the " in the DT" suffix from the missing property messages to match
> the firmware-agnostic property APIs.
> 
> With no OF APIs or struct device_node left in the file, drop the
> <linux/of.h> include and add <linux/mod_devicetable.h> for struct
> of_device_id.
> 
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11 at gmail.com>
> ---
>  drivers/iio/adc/at91_adc.c | 34 +++++++++++++++++-----------------
>  1 file changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index 2a378540837d..b6e6fa77c782 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -15,8 +15,8 @@
>  #include <linux/interrupt.h>
>  #include <linux/jiffies.h>
>  #include <linux/kernel.h>
> +#include <linux/mod_devicetable.h>

Remove this, The corresponding device table is pulled from platform_device.h.

-- 
Kind regards,
Joshua Crofts




More information about the linux-arm-kernel mailing list