diff mbox series

[8/8] iio: buffer: drop devm_iio_kfifo_free() API call

Message ID 20200227135227.12433-8-alexandru.ardelean@analog.com (mailing list archive)
State New, archived
Headers show
Series [1/8] iio: core: drop devm_iio_device_unregister() API call | expand

Commit Message

Alexandru Ardelean Feb. 27, 2020, 1:52 p.m. UTC
It's unused so far, so it can't be removed. Also makes sense to remove it
to discourage weird uses of this call during review.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 .../driver-api/driver-model/devres.rst        |  1 -
 drivers/iio/buffer/kfifo_buf.c                | 22 -------------------
 include/linux/iio/kfifo_buf.h                 |  1 -
 3 files changed, 24 deletions(-)

Comments

Jonathan Cameron April 12, 2020, 1:01 p.m. UTC | #1
On Thu, 27 Feb 2020 15:52:27 +0200
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> It's unused so far, so it can't be removed. Also makes sense to remove it
> to discourage weird uses of this call during review.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied with the can't -> can above fixed up.

Thanks,

Jonathan

> ---
>  .../driver-api/driver-model/devres.rst        |  1 -
>  drivers/iio/buffer/kfifo_buf.c                | 22 -------------------
>  include/linux/iio/kfifo_buf.h                 |  1 -
>  3 files changed, 24 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index 10ccebe9f7c1..91b0b8e5556c 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -286,7 +286,6 @@ IIO
>    devm_iio_device_alloc()
>    devm_iio_device_register()
>    devm_iio_kfifo_allocate()
> -  devm_iio_kfifo_free()
>    devm_iio_triggered_buffer_setup()
>    devm_iio_trigger_alloc()
>    devm_iio_trigger_register()
> diff --git a/drivers/iio/buffer/kfifo_buf.c b/drivers/iio/buffer/kfifo_buf.c
> index 3150f8ab984b..1359abed3b31 100644
> --- a/drivers/iio/buffer/kfifo_buf.c
> +++ b/drivers/iio/buffer/kfifo_buf.c
> @@ -179,16 +179,6 @@ static void devm_iio_kfifo_release(struct device *dev, void *res)
>  	iio_kfifo_free(*(struct iio_buffer **)res);
>  }
>  
> -static int devm_iio_kfifo_match(struct device *dev, void *res, void *data)
> -{
> -	struct iio_buffer **r = res;
> -
> -	if (WARN_ON(!r || !*r))
> -		return 0;
> -
> -	return *r == data;
> -}
> -
>  /**
>   * devm_iio_fifo_allocate - Resource-managed iio_kfifo_allocate()
>   * @dev:		Device to allocate kfifo buffer for
> @@ -216,16 +206,4 @@ struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev)
>  }
>  EXPORT_SYMBOL(devm_iio_kfifo_allocate);
>  
> -/**
> - * devm_iio_fifo_free - Resource-managed iio_kfifo_free()
> - * @dev:		Device the buffer belongs to
> - * @r:			The buffer associated with the device
> - */
> -void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r)
> -{
> -	WARN_ON(devres_release(dev, devm_iio_kfifo_release,
> -			       devm_iio_kfifo_match, r));
> -}
> -EXPORT_SYMBOL(devm_iio_kfifo_free);
> -
>  MODULE_LICENSE("GPL");
> diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h
> index 764659e01b68..1fc1efa7799d 100644
> --- a/include/linux/iio/kfifo_buf.h
> +++ b/include/linux/iio/kfifo_buf.h
> @@ -9,6 +9,5 @@ struct iio_buffer *iio_kfifo_allocate(void);
>  void iio_kfifo_free(struct iio_buffer *r);
>  
>  struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev);
> -void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r);
>  
>  #endif
Alexandru Ardelean April 12, 2020, 2:21 p.m. UTC | #2
On Sun, 2020-04-12 at 14:01 +0100, Jonathan Cameron wrote:
> [External]
> 
> On Thu, 27 Feb 2020 15:52:27 +0200
> Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> 
> > It's unused so far, so it can't be removed. Also makes sense to remove it
> > to discourage weird uses of this call during review.
> > 
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> Applied with the can't -> can above fixed up.
> 

Thanks for noticing the typo.
I should really allocated more brain power to commit comments.
I think I have a bad habit of powering down my brain for the comments, after
doing the code.


> Thanks,
> 
> Jonathan
> 
> > ---
> >  .../driver-api/driver-model/devres.rst        |  1 -
> >  drivers/iio/buffer/kfifo_buf.c                | 22 -------------------
> >  include/linux/iio/kfifo_buf.h                 |  1 -
> >  3 files changed, 24 deletions(-)
> > 
> > diff --git a/Documentation/driver-api/driver-model/devres.rst
> > b/Documentation/driver-api/driver-model/devres.rst
> > index 10ccebe9f7c1..91b0b8e5556c 100644
> > --- a/Documentation/driver-api/driver-model/devres.rst
> > +++ b/Documentation/driver-api/driver-model/devres.rst
> > @@ -286,7 +286,6 @@ IIO
> >    devm_iio_device_alloc()
> >    devm_iio_device_register()
> >    devm_iio_kfifo_allocate()
> > -  devm_iio_kfifo_free()
> >    devm_iio_triggered_buffer_setup()
> >    devm_iio_trigger_alloc()
> >    devm_iio_trigger_register()
> > diff --git a/drivers/iio/buffer/kfifo_buf.c b/drivers/iio/buffer/kfifo_buf.c
> > index 3150f8ab984b..1359abed3b31 100644
> > --- a/drivers/iio/buffer/kfifo_buf.c
> > +++ b/drivers/iio/buffer/kfifo_buf.c
> > @@ -179,16 +179,6 @@ static void devm_iio_kfifo_release(struct device *dev,
> > void *res)
> >  	iio_kfifo_free(*(struct iio_buffer **)res);
> >  }
> >  
> > -static int devm_iio_kfifo_match(struct device *dev, void *res, void *data)
> > -{
> > -	struct iio_buffer **r = res;
> > -
> > -	if (WARN_ON(!r || !*r))
> > -		return 0;
> > -
> > -	return *r == data;
> > -}
> > -
> >  /**
> >   * devm_iio_fifo_allocate - Resource-managed iio_kfifo_allocate()
> >   * @dev:		Device to allocate kfifo buffer for
> > @@ -216,16 +206,4 @@ struct iio_buffer *devm_iio_kfifo_allocate(struct
> > device *dev)
> >  }
> >  EXPORT_SYMBOL(devm_iio_kfifo_allocate);
> >  
> > -/**
> > - * devm_iio_fifo_free - Resource-managed iio_kfifo_free()
> > - * @dev:		Device the buffer belongs to
> > - * @r:			The buffer associated with the device
> > - */
> > -void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r)
> > -{
> > -	WARN_ON(devres_release(dev, devm_iio_kfifo_release,
> > -			       devm_iio_kfifo_match, r));
> > -}
> > -EXPORT_SYMBOL(devm_iio_kfifo_free);
> > -
> >  MODULE_LICENSE("GPL");
> > diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h
> > index 764659e01b68..1fc1efa7799d 100644
> > --- a/include/linux/iio/kfifo_buf.h
> > +++ b/include/linux/iio/kfifo_buf.h
> > @@ -9,6 +9,5 @@ struct iio_buffer *iio_kfifo_allocate(void);
> >  void iio_kfifo_free(struct iio_buffer *r);
> >  
> >  struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev);
> > -void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r);
> >  
> >  #endif
diff mbox series

Patch

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 10ccebe9f7c1..91b0b8e5556c 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -286,7 +286,6 @@  IIO
   devm_iio_device_alloc()
   devm_iio_device_register()
   devm_iio_kfifo_allocate()
-  devm_iio_kfifo_free()
   devm_iio_triggered_buffer_setup()
   devm_iio_trigger_alloc()
   devm_iio_trigger_register()
diff --git a/drivers/iio/buffer/kfifo_buf.c b/drivers/iio/buffer/kfifo_buf.c
index 3150f8ab984b..1359abed3b31 100644
--- a/drivers/iio/buffer/kfifo_buf.c
+++ b/drivers/iio/buffer/kfifo_buf.c
@@ -179,16 +179,6 @@  static void devm_iio_kfifo_release(struct device *dev, void *res)
 	iio_kfifo_free(*(struct iio_buffer **)res);
 }
 
-static int devm_iio_kfifo_match(struct device *dev, void *res, void *data)
-{
-	struct iio_buffer **r = res;
-
-	if (WARN_ON(!r || !*r))
-		return 0;
-
-	return *r == data;
-}
-
 /**
  * devm_iio_fifo_allocate - Resource-managed iio_kfifo_allocate()
  * @dev:		Device to allocate kfifo buffer for
@@ -216,16 +206,4 @@  struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev)
 }
 EXPORT_SYMBOL(devm_iio_kfifo_allocate);
 
-/**
- * devm_iio_fifo_free - Resource-managed iio_kfifo_free()
- * @dev:		Device the buffer belongs to
- * @r:			The buffer associated with the device
- */
-void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r)
-{
-	WARN_ON(devres_release(dev, devm_iio_kfifo_release,
-			       devm_iio_kfifo_match, r));
-}
-EXPORT_SYMBOL(devm_iio_kfifo_free);
-
 MODULE_LICENSE("GPL");
diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h
index 764659e01b68..1fc1efa7799d 100644
--- a/include/linux/iio/kfifo_buf.h
+++ b/include/linux/iio/kfifo_buf.h
@@ -9,6 +9,5 @@  struct iio_buffer *iio_kfifo_allocate(void);
 void iio_kfifo_free(struct iio_buffer *r);
 
 struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev);
-void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r);
 
 #endif