Re: [PATCH v7 4/7] iio: dac: ad5686: implement new sync() op for the spi bus
From: Andy Shevchenko
Date: Mon Jul 13 2026 - 12:46:16 EST
On Mon, Jul 13, 2026 at 05:18:14PM +0100, Rodrigo Alencar wrote:
> 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:
...
> > > 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.
Looking at this again, there is kinda static data (the one that you know at
the probe stage) and dynamic (like memory for transfers), so static one indeed
can be part of driver_data, but the dynamic ones rather fit ad5686_state.
--
With Best Regards,
Andy Shevchenko