diff mbox series

iio: buffer-dmaengine: make use of the 'struct device *' argument

Message ID 20240109-dmaengine_use_device-v1-1-1cbdb7fe9f29@analog.com (mailing list archive)
State Accepted
Headers show
Series iio: buffer-dmaengine: make use of the 'struct device *' argument | expand

Commit Message

Nuno Sa Jan. 9, 2024, 2:03 p.m. UTC
Respect the @dev argument in devm_iio_dmaengine_buffer_setup() and bind the
IIO DMA buffer lifetime to that device.

For the only user of this function, the IIO parent device is the
struct device being passed to the API so no real fix in here (just
consistency with other IIO APIs).

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 drivers/iio/buffer/industrialio-buffer-dmaengine.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


---
base-commit: 3f4525f924e21d4f532517b17a20ffa5df7c0db7
change-id: 20240109-dmaengine_use_device-853f196ec78f
--

Thanks!
- Nuno Sá

Comments

David Lechner Jan. 9, 2024, 5:56 p.m. UTC | #1
On Tue, Jan 9, 2024 at 9:47 AM Nuno Sa <nuno.sa@analog.com> wrote:
>
> Respect the @dev argument in devm_iio_dmaengine_buffer_setup() and bind the
> IIO DMA buffer lifetime to that device.
>
> For the only user of this function, the IIO parent device is the
> struct device being passed to the API so no real fix in here (just
> consistency with other IIO APIs).
>
> Signed-off-by: Nuno Sa <nuno.sa@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 5f85ba38e6f6..45fe7d0d42ee 100644
> --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> @@ -279,8 +279,7 @@ int devm_iio_dmaengine_buffer_setup(struct device *dev,
>  {
>         struct iio_buffer *buffer;
>
> -       buffer = devm_iio_dmaengine_buffer_alloc(indio_dev->dev.parent,
> -                                                channel);
> +       buffer = devm_iio_dmaengine_buffer_alloc(dev, channel);
>         if (IS_ERR(buffer))
>                 return PTR_ERR(buffer);
>
>
> ---
> base-commit: 3f4525f924e21d4f532517b17a20ffa5df7c0db7
> change-id: 20240109-dmaengine_use_device-853f196ec78f
> --
>
> Thanks!
> - Nuno Sá
>
>

I noticed this too but didn't get around to fixing it yet. ;-)

Reviewed-by: David Lechner <dlechner@baylibre.com>
Jonathan Cameron Jan. 13, 2024, 3:28 p.m. UTC | #2
On Tue, 9 Jan 2024 11:56:47 -0600
David Lechner <dlechner@baylibre.com> wrote:

> On Tue, Jan 9, 2024 at 9:47 AM Nuno Sa <nuno.sa@analog.com> wrote:
> >
> > Respect the @dev argument in devm_iio_dmaengine_buffer_setup() and bind the
> > IIO DMA buffer lifetime to that device.
> >
> > For the only user of this function, the IIO parent device is the
> > struct device being passed to the API so no real fix in here (just
> > consistency with other IIO APIs).
> >
> > Signed-off-by: Nuno Sa <nuno.sa@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 5f85ba38e6f6..45fe7d0d42ee 100644
> > --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> > +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> > @@ -279,8 +279,7 @@ int devm_iio_dmaengine_buffer_setup(struct device *dev,
> >  {
> >         struct iio_buffer *buffer;
> >
> > -       buffer = devm_iio_dmaengine_buffer_alloc(indio_dev->dev.parent,
> > -                                                channel);
> > +       buffer = devm_iio_dmaengine_buffer_alloc(dev, channel);
> >         if (IS_ERR(buffer))
> >                 return PTR_ERR(buffer);
> >
> >
> > ---
> > base-commit: 3f4525f924e21d4f532517b17a20ffa5df7c0db7
> > change-id: 20240109-dmaengine_use_device-853f196ec78f
> > --
> >
> > Thanks!
> > - Nuno Sá
> >
> >  
> 
> I noticed this too but didn't get around to fixing it yet. ;-)
> 
> Reviewed-by: David Lechner <dlechner@baylibre.com>
Applied
diff mbox series

Patch

diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
index 5f85ba38e6f6..45fe7d0d42ee 100644
--- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
+++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
@@ -279,8 +279,7 @@  int devm_iio_dmaengine_buffer_setup(struct device *dev,
 {
 	struct iio_buffer *buffer;
 
-	buffer = devm_iio_dmaengine_buffer_alloc(indio_dev->dev.parent,
-						 channel);
+	buffer = devm_iio_dmaengine_buffer_alloc(dev, channel);
 	if (IS_ERR(buffer))
 		return PTR_ERR(buffer);