diff mbox series

[v2,1/9] iio: buffer: dmaengine: unwrap the use of iio_buffer_set_attrs()

Message ID 20200929070908.10456-2-alexandru.ardelean@analog.com (mailing list archive)
State New, archived
Headers show
Series iio: remove iio_buffer_set_attrs() and assign buffer attrs during alloc | expand

Commit Message

Alexandru Ardelean Sept. 29, 2020, 7:09 a.m. UTC
The iio_buffer_set_attrs() helper will be removed in this series. So, just
assign the attributes of the DMAEngine buffer logic directly.

This is IIO buffer core context, so there is direct access to the
buffer->attrs object.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/iio/buffer/industrialio-buffer-dmaengine.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andy Shevchenko Sept. 29, 2020, 7:48 a.m. UTC | #1
On Tue, Sep 29, 2020 at 10:09 AM Alexandru Ardelean
<alexandru.ardelean@analog.com> wrote:
>
> The iio_buffer_set_attrs() helper will be removed in this series. So, just
> assign the attributes of the DMAEngine buffer logic directly.
>
> This is IIO buffer core context, so there is direct access to the
> buffer->attrs object.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
>  drivers/iio/buffer/industrialio-buffer-dmaengine.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> index 93b4e9e6bb55..becea9f68181 100644
> --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> @@ -200,8 +200,7 @@ static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
>
>         iio_dma_buffer_init(&dmaengine_buffer->queue, chan->device->dev,
>                 &iio_dmaengine_default_ops);
> -       iio_buffer_set_attrs(&dmaengine_buffer->queue.buffer,
> -               iio_dmaengine_buffer_attrs);
> +       dmaengine_buffer->queue.buffer.attrs = iio_dmaengine_buffer_attrs;
>
>         dmaengine_buffer->queue.buffer.access = &iio_dmaengine_buffer_ops;

A nit: can we group assignments together, like
init()
...blank line...
attr = ...
access = ...

?

>
> --
> 2.17.1
>
Alexandru Ardelean Sept. 29, 2020, 8:13 a.m. UTC | #2
On Tue, Sep 29, 2020 at 10:49 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Sep 29, 2020 at 10:09 AM Alexandru Ardelean
> <alexandru.ardelean@analog.com> wrote:
> >
> > The iio_buffer_set_attrs() helper will be removed in this series. So, just
> > assign the attributes of the DMAEngine buffer logic directly.
> >
> > This is IIO buffer core context, so there is direct access to the
> > buffer->attrs object.
> >
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> >  drivers/iio/buffer/industrialio-buffer-dmaengine.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> > index 93b4e9e6bb55..becea9f68181 100644
> > --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> > +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> > @@ -200,8 +200,7 @@ static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
> >
> >         iio_dma_buffer_init(&dmaengine_buffer->queue, chan->device->dev,
> >                 &iio_dmaengine_default_ops);
> > -       iio_buffer_set_attrs(&dmaengine_buffer->queue.buffer,
> > -               iio_dmaengine_buffer_attrs);
> > +       dmaengine_buffer->queue.buffer.attrs = iio_dmaengine_buffer_attrs;
> >
> >         dmaengine_buffer->queue.buffer.access = &iio_dmaengine_buffer_ops;
>
> A nit: can we group assignments together, like
> init()
> ...blank line...
> attr = ...
> access = ...

fine by me

>
> ?
>
> >
> > --
> > 2.17.1
> >
>
>
> --
> With Best Regards,
> Andy Shevchenko
diff mbox series

Patch

diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
index 93b4e9e6bb55..becea9f68181 100644
--- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
+++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
@@ -200,8 +200,7 @@  static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
 
 	iio_dma_buffer_init(&dmaengine_buffer->queue, chan->device->dev,
 		&iio_dmaengine_default_ops);
-	iio_buffer_set_attrs(&dmaengine_buffer->queue.buffer,
-		iio_dmaengine_buffer_attrs);
+	dmaengine_buffer->queue.buffer.attrs = iio_dmaengine_buffer_attrs;
 
 	dmaengine_buffer->queue.buffer.access = &iio_dmaengine_buffer_ops;