On Tue, Jun 16, 2026 at 09:21:15AM +0100, Rodrigo Alencar via B4 Relay wrote:

> Use of local SPI bus data to manage a collection of SPI transfers and
> flush them to the SPI platform driver with the sync() operation. This
> allows for faster handling of multiple channel DAC writes, avoiding kernel
> overhead per spi_sync() call, which will be helpful when enabling
> triggered buffer support.

...

>  static int ad5686_spi_probe(struct spi_device *spi)
>  {
> -     return ad5686_probe(&spi->dev, spi_get_device_match_data(spi),
> -                         spi->modalias, &ad5686_spi_ops);
> +     const struct ad5686_chip_info *info = spi_get_device_match_data(spi);

Sashiko might still complain on driver_override case, which means we need to
add a NULL check (or is NULL fine?).

> +     struct ad5686_spi_data *bus_data;
> +     struct device *dev = &spi->dev;
> +     unsigned int capacity;
> +
> +     /* read operation requires at least 2 transfers */
> +     capacity = max(info->num_channels, 2);
> +     bus_data = devm_kzalloc(dev, struct_size(bus_data, xfers, capacity),
> +                             GFP_KERNEL);
> +     if (!bus_data)
> +             return -ENOMEM;
> +
> +     bus_data->capacity = capacity;
> +
> +     return ad5686_probe(dev, info, spi->modalias, &ad5686_spi_ops, 
> bus_data);
>  }

-- 
With Best Regards,
Andy Shevchenko



Reply via email to