On 12/07/26 10:03, Andy Shevchenko wrote:
> On Fri, Jul 10, 2026 at 12:20:48PM +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.
> 
> ...
> 
> >  int ad5686_probe(struct device *dev,
> >              const struct ad5686_chip_info *chip_info,
> > -            const char *name, const struct ad5686_bus_ops *ops)
> > +            const char *name, const struct ad5686_bus_ops *ops,
> > +            void *bus_data)
> 
> Can't you utilise the dev->platform_data for this? I believe it's exactly
> the case where it suits.

I could use dev_set_drvdata(), I understand that platform_data is to be injected
by the board/platform configuration.

SPI/I2C cores do write it, from the board-info structs at device creation:
    - drivers/spi/spi.c:835
        proxy->dev.platform_data = (void *) chip->platform_data; (from 
spi_board_info::platform_data)
    - drivers/i2c/i2c-core-base.c:973
        client->dev.platform_data = info->platform_data; (from 
i2c_board_info::platform_data)

After device creation, the core itself doesn't touch it.

-- 
Kind regards,

Rodrigo Alencar

Reply via email to