Re: [PATCH] iio: adc: ad4062: Switch from struct i3c_priv_xfer to struct i3c_xfer

Alexandre Belloni
2026-01-20T23:09:40Z

On 19/01/2026 21:36:17+0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> commit 9904232ae30bc ("i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()")
> currently in the i3c/for-next tree removes the deprecated
> struct i3c_priv_xfer and i3c_device_do_priv_xfers().
>
> Switch to struct i3c_xfer and i3c_device_do_xfers(..., I3C_SDR)
> now rather causing a build issue when both trees are merged.
>
> Suggested-by: Sasha Levin <sashal@kernel.org>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: jorge.marques@analog.com
> ---
> I'm already carrying this on my tree to resolve the issue in next
> but feedback still welcome!

This looks fine to me, I'm sorry this patch is causing you so much
troubles, I was pretty sure every drivers where converted so I took me a
while to understand that this is actually a new driver, I didn't expect
this!

> ---
> drivers/iio/adc/ad4062.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/iio/adc/ad4062.c b/drivers/iio/adc/ad4062.c
> index a6b3ccc98acf..dd4ad32aa6f5 100644
> --- a/drivers/iio/adc/ad4062.c
> +++ b/drivers/iio/adc/ad4062.c
> @@ -468,13 +468,13 @@ static int ad4062_set_operation_mode(struct ad4062_state *st,
>
> if (mode == AD4062_MONITOR_MODE) {
> /* Change address pointer to enter monitor mode */
> - struct i3c_priv_xfer xfer_trigger = {
> + struct i3c_xfer xfer_trigger = {
> .data.out = &st->conv_addr,
> .len = sizeof(st->conv_addr),
> .rnw = false,
> };
> st->conv_addr = AD4062_REG_CONV_TRIGGER_32BITS;
> - return i3c_device_do_priv_xfers(st->i3cdev, &xfer_trigger, 1);
> + return i3c_device_do_xfers(st->i3cdev, &xfer_trigger, 1, I3C_SDR);
> }
>
> return regmap_write(st->regmap, AD4062_REG_MODE_SET,
> @@ -607,18 +607,18 @@ static void ad4062_trigger_work(struct work_struct *work)
> * Read current conversion, if at reg CONV_READ, stop bit triggers
> * next sample and does not need writing the address.
> */
> - struct i3c_priv_xfer xfer_sample = {
> + struct i3c_xfer xfer_sample = {
> .data.in = &st->buf.be32,
> .len = st->conv_sizeof,
> .rnw = true,
> };
> - struct i3c_priv_xfer xfer_trigger = {
> + struct i3c_xfer xfer_trigger = {
> .data.out = &st->conv_addr,
> .len = sizeof(st->conv_addr),
> .rnw = false,
> };
>
> - ret = i3c_device_do_priv_xfers(st->i3cdev, &xfer_sample, 1);
> + ret = i3c_device_do_xfers(st->i3cdev, &xfer_sample, 1, I3C_SDR);
> if (ret)
> return;
>
> @@ -627,7 +627,7 @@ static void ad4062_trigger_work(struct work_struct *work)
> if (st->gpo_irq[1])
> return;
>
> - i3c_device_do_priv_xfers(st->i3cdev, &xfer_trigger, 1);
> + i3c_device_do_xfers(st->i3cdev, &xfer_trigger, 1, I3C_SDR);
> }
>
> static irqreturn_t ad4062_poll_handler(int irq, void *p)
> @@ -852,12 +852,12 @@ static int ad4062_set_chan_calibscale(struct ad4062_state *st, int gain_int,
> static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
> {
> struct i3c_device *i3cdev = st->i3cdev;
> - struct i3c_priv_xfer xfer_trigger = {
> + struct i3c_xfer xfer_trigger = {
> .data.out = &st->conv_addr,
> .len = sizeof(st->conv_addr),
> .rnw = false,
> };
> - struct i3c_priv_xfer xfer_sample = {
> + struct i3c_xfer xfer_sample = {
> .data.in = &st->buf.be32,
> .len = sizeof(st->buf.be32),
> .rnw = true,
> @@ -876,7 +876,7 @@ static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
> reinit_completion(&st->completion);
> /* Change address pointer to trigger conversion */
> st->conv_addr = AD4062_REG_CONV_TRIGGER_32BITS;
> - ret = i3c_device_do_priv_xfers(i3cdev, &xfer_trigger, 1);
> + ret = i3c_device_do_xfers(i3cdev, &xfer_trigger, 1, I3C_SDR);
> if (ret)
> return ret;
> /*
> @@ -888,7 +888,7 @@ static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
> if (!ret)
> return -ETIMEDOUT;
>
> - ret = i3c_device_do_priv_xfers(i3cdev, &xfer_sample, 1);
> + ret = i3c_device_do_xfers(i3cdev, &xfer_sample, 1, I3C_SDR);
> if (ret)
> return ret;
> *val = be32_to_cpu(st->buf.be32);
> @@ -1236,7 +1236,7 @@ static int pm_ad4062_triggered_buffer_postenable(struct ad4062_state *st)
> st->conv_sizeof = ad4062_sizeof_storagebits(st);
> st->conv_addr = ad4062_get_conv_addr(st, st->conv_sizeof);
> /* CONV_READ requires read to trigger first sample. */
> - struct i3c_priv_xfer xfer_sample[2] = {
> + struct i3c_xfer xfer_sample[2] = {
> {
> .data.out = &st->conv_addr,
> .len = sizeof(st->conv_addr),
> @@ -1249,8 +1249,8 @@ static int pm_ad4062_triggered_buffer_postenable(struct ad4062_state *st)
> }
> };
>
> - return i3c_device_do_priv_xfers(st->i3cdev, xfer_sample,
> - st->gpo_irq[1] ? 2 : 1);
> + return i3c_device_do_xfers(st->i3cdev, xfer_sample,
> + st->gpo_irq[1] ? 2 : 1, I3C_SDR);
> }
>
> static int ad4062_triggered_buffer_postenable(struct iio_dev *indio_dev)
> --
> 2.52.0
>

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering