Re: [PATCH v3 03/13] spi: parse two-element spi-max-frequency property
From: Miquel Raynal
Date: Thu May 28 2026 - 04:43:10 EST
>
> - /* Device speed */
> - if (!of_property_read_u32(nc, "spi-max-frequency", &value))
> + /*
> + * Device speed: a single value sets max_speed_hz; two values set
> + * base_speed_hz (conservative) and max_speed_hz (maximum after
> + * controller-side configuration).
> + */
> + nfreq = of_property_count_u32_elems(nc, "spi-max-frequency");
> + if (nfreq == 2) {
> + of_property_read_u32_index(nc, "spi-max-frequency", 0,
> + &spi->base_speed_hz);
> + of_property_read_u32_index(nc, "spi-max-frequency", 1,
> + &spi->max_speed_hz);
I don't know how useful that is, but I would use an intermediate
variable and check the return value of the of_property_* helper before
filling spi->max|base_speed_hz.
With this fixed,
Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Thanks,
Miquèl