linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call
@ 2020-02-27 13:52 Alexandru Ardelean
  2020-02-27 13:52 ` [PATCH 2/8] iio: core: drop devm_iio_triggered_buffer_cleanup() " Alexandru Ardelean
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

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/industrialio-core.c                 | 17 -----------------
 include/linux/iio/iio.h                         |  4 ----
 3 files changed, 22 deletions(-)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 46c13780994c..0580c64ebdfd 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_free()
   devm_iio_device_register()
-  devm_iio_device_unregister()
   devm_iio_kfifo_allocate()
   devm_iio_kfifo_free()
   devm_iio_triggered_buffer_setup()
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 0b14666dff09..e4011f8431f9 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -1823,23 +1823,6 @@ int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
 }
 EXPORT_SYMBOL_GPL(__devm_iio_device_register);
 
-/**
- * devm_iio_device_unregister - Resource-managed iio_device_unregister()
- * @dev:	Device this iio_dev belongs to
- * @indio_dev:	the iio_dev associated with the device
- *
- * Unregister iio_dev registered with devm_iio_device_register().
- */
-void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev)
-{
-	int rc;
-
-	rc = devres_release(dev, devm_iio_device_unreg,
-			    devm_iio_device_match, indio_dev);
-	WARN_ON(rc);
-}
-EXPORT_SYMBOL_GPL(devm_iio_device_unregister);
-
 /**
  * iio_device_claim_direct_mode - Keep device in direct mode
  * @indio_dev:	the iio_dev associated with the device
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 862ce0019eba..0eb9e8d7ec68 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -591,9 +591,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
  * calls iio_device_register() internally. Refer to that function for more
  * information.
  *
- * If an iio_dev registered with this function needs to be unregistered
- * separately, devm_iio_device_unregister() must be used.
- *
  * RETURNS:
  * 0 on success, negative error number on failure.
  */
@@ -601,7 +598,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
 	__devm_iio_device_register((dev), (indio_dev), THIS_MODULE);
 int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
 			       struct module *this_mod);
-void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev);
 int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
 int iio_device_claim_direct_mode(struct iio_dev *indio_dev);
 void iio_device_release_direct_mode(struct iio_dev *indio_dev);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/8] iio: core: drop devm_iio_triggered_buffer_cleanup() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
@ 2020-02-27 13:52 ` Alexandru Ardelean
  2020-04-12 12:33   ` Jonathan Cameron
  2020-02-27 13:52 ` [PATCH 3/8] iio: core: drop devm_iio_device_free() " Alexandru Ardelean
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

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>
---
 Documentation/driver-api/driver-model/devres.rst   |  1 -
 drivers/iio/buffer/industrialio-triggered-buffer.c | 11 -----------
 include/linux/iio/triggered_buffer.h               |  2 --
 3 files changed, 14 deletions(-)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 0580c64ebdfd..1431d5e44abc 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -289,7 +289,6 @@ IIO
   devm_iio_kfifo_allocate()
   devm_iio_kfifo_free()
   devm_iio_triggered_buffer_setup()
-  devm_iio_triggered_buffer_cleanup()
   devm_iio_trigger_alloc()
   devm_iio_trigger_free()
   devm_iio_trigger_register()
diff --git a/drivers/iio/buffer/industrialio-triggered-buffer.c b/drivers/iio/buffer/industrialio-triggered-buffer.c
index cb322b2f09cd..e8046c1ecd6b 100644
--- a/drivers/iio/buffer/industrialio-triggered-buffer.c
+++ b/drivers/iio/buffer/industrialio-triggered-buffer.c
@@ -126,17 +126,6 @@ int devm_iio_triggered_buffer_setup(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(devm_iio_triggered_buffer_setup);
 
-void devm_iio_triggered_buffer_cleanup(struct device *dev,
-				       struct iio_dev *indio_dev)
-{
-	int rc;
-
-	rc = devres_release(dev, devm_iio_triggered_buffer_clean,
-			    devm_iio_device_match, indio_dev);
-	WARN_ON(rc);
-}
-EXPORT_SYMBOL_GPL(devm_iio_triggered_buffer_cleanup);
-
 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
 MODULE_DESCRIPTION("IIO helper functions for setting up triggered buffers");
 MODULE_LICENSE("GPL");
diff --git a/include/linux/iio/triggered_buffer.h b/include/linux/iio/triggered_buffer.h
index 238ad30ce166..e99c91799359 100644
--- a/include/linux/iio/triggered_buffer.h
+++ b/include/linux/iio/triggered_buffer.h
@@ -18,7 +18,5 @@ int devm_iio_triggered_buffer_setup(struct device *dev,
 				    irqreturn_t (*h)(int irq, void *p),
 				    irqreturn_t (*thread)(int irq, void *p),
 				    const struct iio_buffer_setup_ops *ops);
-void devm_iio_triggered_buffer_cleanup(struct device *dev,
-				       struct iio_dev *indio_dev);
 
 #endif
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/8] iio: core: drop devm_iio_device_free() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
  2020-02-27 13:52 ` [PATCH 2/8] iio: core: drop devm_iio_triggered_buffer_cleanup() " Alexandru Ardelean
@ 2020-02-27 13:52 ` Alexandru Ardelean
  2020-04-12 12:36   ` Jonathan Cameron
  2020-02-27 13:52 ` [PATCH 4/8] iio: core: drop devm_iio_trigger_unregister() " Alexandru Ardelean
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

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.

This is the last user of 'devm_iio_device_match()', so it can be removed as
well in this patch.

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

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 1431d5e44abc..6ae6c67dfec0 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -284,7 +284,6 @@ I2C
 
 IIO
   devm_iio_device_alloc()
-  devm_iio_device_free()
   devm_iio_device_register()
   devm_iio_kfifo_allocate()
   devm_iio_kfifo_free()
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index e4011f8431f9..ebe338a0494f 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -1539,17 +1539,6 @@ static void devm_iio_device_release(struct device *dev, void *res)
 	iio_device_free(*(struct iio_dev **)res);
 }
 
-int devm_iio_device_match(struct device *dev, void *res, void *data)
-{
-	struct iio_dev **r = res;
-	if (!r || !*r) {
-		WARN_ON(!r || !*r);
-		return 0;
-	}
-	return *r == data;
-}
-EXPORT_SYMBOL_GPL(devm_iio_device_match);
-
 /**
  * devm_iio_device_alloc - Resource-managed iio_device_alloc()
  * @dev:		Device to allocate iio_dev for
@@ -1558,9 +1547,6 @@ EXPORT_SYMBOL_GPL(devm_iio_device_match);
  * Managed iio_device_alloc. iio_dev allocated with this function is
  * automatically freed on driver detach.
  *
- * If an iio_dev allocated with this function needs to be freed separately,
- * devm_iio_device_free() must be used.
- *
  * RETURNS:
  * Pointer to allocated iio_dev on success, NULL on failure.
  */
@@ -1585,23 +1571,6 @@ struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv)
 }
 EXPORT_SYMBOL_GPL(devm_iio_device_alloc);
 
-/**
- * devm_iio_device_free - Resource-managed iio_device_free()
- * @dev:		Device this iio_dev belongs to
- * @iio_dev:		the iio_dev associated with the device
- *
- * Free iio_dev allocated with devm_iio_device_alloc().
- */
-void devm_iio_device_free(struct device *dev, struct iio_dev *iio_dev)
-{
-	int rc;
-
-	rc = devres_release(dev, devm_iio_device_release,
-			    devm_iio_device_match, iio_dev);
-	WARN_ON(rc);
-}
-EXPORT_SYMBOL_GPL(devm_iio_device_free);
-
 /**
  * iio_chrdev_open() - chrdev file open for buffer access and ioctls
  * @inode:	Inode structure for identifying the device in the file system
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 0eb9e8d7ec68..2920c065ab9b 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -686,9 +686,7 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
 }
 
 void iio_device_free(struct iio_dev *indio_dev);
-int devm_iio_device_match(struct device *dev, void *res, void *data);
 struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
-void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
 struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
 						const char *fmt, ...);
 void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/8] iio: core: drop devm_iio_trigger_unregister() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
  2020-02-27 13:52 ` [PATCH 2/8] iio: core: drop devm_iio_triggered_buffer_cleanup() " Alexandru Ardelean
  2020-02-27 13:52 ` [PATCH 3/8] iio: core: drop devm_iio_device_free() " Alexandru Ardelean
@ 2020-02-27 13:52 ` Alexandru Ardelean
  2020-04-12 12:51   ` Jonathan Cameron
  2020-02-27 13:52 ` [PATCH 5/8] iio: core: drop devm_iio_trigger_free() " Alexandru Ardelean
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 3521 bytes --]

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 -
 Documentation/driver-api/iio/triggers.rst     |  1 -
 drivers/iio/industrialio-trigger.c            | 21 -------------------
 include/linux/iio/trigger.h                   |  3 ---
 4 files changed, 26 deletions(-)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 6ae6c67dfec0..f638a035e6d2 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -291,7 +291,6 @@ IIO
   devm_iio_trigger_alloc()
   devm_iio_trigger_free()
   devm_iio_trigger_register()
-  devm_iio_trigger_unregister()
   devm_iio_channel_get()
   devm_iio_channel_release()
   devm_iio_channel_get_all()
diff --git a/Documentation/driver-api/iio/triggers.rst b/Documentation/driver-api/iio/triggers.rst
index 5c2156de6284..160faa810d12 100644
--- a/Documentation/driver-api/iio/triggers.rst
+++ b/Documentation/driver-api/iio/triggers.rst
@@ -6,7 +6,6 @@ Triggers
 * :c:func:`devm_iio_trigger_alloc` — Resource-managed iio_trigger_alloc
 * :c:func:`devm_iio_trigger_free` — Resource-managed iio_trigger_free
 * :c:func:`devm_iio_trigger_register` — Resource-managed iio_trigger_register
-* :c:func:`devm_iio_trigger_unregister` — Resource-managed
   iio_trigger_unregister
 * :c:func:`iio_trigger_validate_own_device` — Check if a trigger and IIO
   device belong to the same device
diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 3908a9a90035..611f608a9da2 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -673,9 +673,6 @@ static void devm_iio_trigger_unreg(struct device *dev, void *res)
  * calls iio_trigger_register() internally. Refer to that function for more
  * information.
  *
- * If an iio_trigger registered with this function needs to be unregistered
- * separately, devm_iio_trigger_unregister() must be used.
- *
  * RETURNS:
  * 0 on success, negative error number on failure.
  */
@@ -701,24 +698,6 @@ int __devm_iio_trigger_register(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(__devm_iio_trigger_register);
 
-/**
- * devm_iio_trigger_unregister - Resource-managed iio_trigger_unregister()
- * @dev:	device this iio_trigger belongs to
- * @trig_info:	the trigger associated with the device
- *
- * Unregister trigger registered with devm_iio_trigger_register().
- */
-void devm_iio_trigger_unregister(struct device *dev,
-				 struct iio_trigger *trig_info)
-{
-	int rc;
-
-	rc = devres_release(dev, devm_iio_trigger_unreg, devm_iio_trigger_match,
-			    trig_info);
-	WARN_ON(rc);
-}
-EXPORT_SYMBOL_GPL(devm_iio_trigger_unregister);
-
 bool iio_trigger_using_own(struct iio_dev *indio_dev)
 {
 	return indio_dev->trig->attached_own_device;
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index 84995e2967ac..cad8325903f9 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -141,9 +141,6 @@ int __devm_iio_trigger_register(struct device *dev,
  **/
 void iio_trigger_unregister(struct iio_trigger *trig_info);
 
-void devm_iio_trigger_unregister(struct device *dev,
-				 struct iio_trigger *trig_info);
-
 /**
  * iio_trigger_set_immutable() - set an immutable trigger on destination
  *
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 5/8] iio: core: drop devm_iio_trigger_free() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
                   ` (2 preceding siblings ...)
  2020-02-27 13:52 ` [PATCH 4/8] iio: core: drop devm_iio_trigger_unregister() " Alexandru Ardelean
@ 2020-02-27 13:52 ` Alexandru Ardelean
  2020-04-12 12:57   ` Jonathan Cameron
  2020-02-27 13:52 ` [PATCH 6/8] iio: inkern: drop devm_iio_channel_release{_all} API calls Alexandru Ardelean
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 4094 bytes --]

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 -
 Documentation/driver-api/iio/triggers.rst     |  1 -
 drivers/iio/industrialio-trigger.c            | 32 -------------------
 include/linux/iio/iio.h                       |  2 --
 4 files changed, 36 deletions(-)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index f638a035e6d2..6c401c74e480 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -289,7 +289,6 @@ IIO
   devm_iio_kfifo_free()
   devm_iio_triggered_buffer_setup()
   devm_iio_trigger_alloc()
-  devm_iio_trigger_free()
   devm_iio_trigger_register()
   devm_iio_channel_get()
   devm_iio_channel_release()
diff --git a/Documentation/driver-api/iio/triggers.rst b/Documentation/driver-api/iio/triggers.rst
index 160faa810d12..dfd7ba3eabde 100644
--- a/Documentation/driver-api/iio/triggers.rst
+++ b/Documentation/driver-api/iio/triggers.rst
@@ -4,7 +4,6 @@ Triggers
 
 * struct :c:type:`iio_trigger` — industrial I/O trigger device
 * :c:func:`devm_iio_trigger_alloc` — Resource-managed iio_trigger_alloc
-* :c:func:`devm_iio_trigger_free` — Resource-managed iio_trigger_free
 * :c:func:`devm_iio_trigger_register` — Resource-managed iio_trigger_register
   iio_trigger_unregister
 * :c:func:`iio_trigger_validate_own_device` — Check if a trigger and IIO
diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 611f608a9da2..53d1931f6be8 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -585,18 +585,6 @@ static void devm_iio_trigger_release(struct device *dev, void *res)
 	iio_trigger_free(*(struct iio_trigger **)res);
 }
 
-static int devm_iio_trigger_match(struct device *dev, void *res, void *data)
-{
-	struct iio_trigger **r = res;
-
-	if (!r || !*r) {
-		WARN_ON(!r || !*r);
-		return 0;
-	}
-
-	return *r == data;
-}
-
 /**
  * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc()
  * @dev:		Device to allocate iio_trigger for
@@ -608,9 +596,6 @@ static int devm_iio_trigger_match(struct device *dev, void *res, void *data)
  * Managed iio_trigger_alloc.  iio_trigger allocated with this function is
  * automatically freed on driver detach.
  *
- * If an iio_trigger allocated with this function needs to be freed separately,
- * devm_iio_trigger_free() must be used.
- *
  * RETURNS:
  * Pointer to allocated iio_trigger on success, NULL on failure.
  */
@@ -640,23 +625,6 @@ struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(devm_iio_trigger_alloc);
 
-/**
- * devm_iio_trigger_free - Resource-managed iio_trigger_free()
- * @dev:		Device this iio_dev belongs to
- * @iio_trig:		the iio_trigger associated with the device
- *
- * Free iio_trigger allocated with devm_iio_trigger_alloc().
- */
-void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig)
-{
-	int rc;
-
-	rc = devres_release(dev, devm_iio_trigger_release,
-			    devm_iio_trigger_match, iio_trig);
-	WARN_ON(rc);
-}
-EXPORT_SYMBOL_GPL(devm_iio_trigger_free);
-
 static void devm_iio_trigger_unreg(struct device *dev, void *res)
 {
 	iio_trigger_unregister(*(struct iio_trigger **)res);
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 2920c065ab9b..1a5d3d630ec1 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -689,8 +689,6 @@ void iio_device_free(struct iio_dev *indio_dev);
 struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
 struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
 						const char *fmt, ...);
-void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
-
 /**
  * iio_buffer_enabled() - helper function to test if the buffer is enabled
  * @indio_dev:		IIO device structure for device
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 6/8] iio: inkern: drop devm_iio_channel_release{_all} API calls
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
                   ` (3 preceding siblings ...)
  2020-02-27 13:52 ` [PATCH 5/8] iio: core: drop devm_iio_trigger_free() " Alexandru Ardelean
@ 2020-02-27 13:52 ` Alexandru Ardelean
  2020-04-12 12:58   ` Jonathan Cameron
  2020-02-27 13:52 ` [PATCH 7/8] iio: buffer: drop devm_iio_hw_consumer_free() API call Alexandru Ardelean
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

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        |  2 --
 drivers/iio/inkern.c                          | 27 -------------------
 include/linux/iio/consumer.h                  | 18 -------------
 3 files changed, 47 deletions(-)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 6c401c74e480..10ccebe9f7c1 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -291,9 +291,7 @@ IIO
   devm_iio_trigger_alloc()
   devm_iio_trigger_register()
   devm_iio_channel_get()
-  devm_iio_channel_release()
   devm_iio_channel_get_all()
-  devm_iio_channel_release_all()
 
 INPUT
   devm_input_allocate_device()
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index 5a8351c9a426..ede99e0d5371 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -360,18 +360,6 @@ static void devm_iio_channel_free(struct device *dev, void *res)
 	iio_channel_release(channel);
 }
 
-static int devm_iio_channel_match(struct device *dev, void *res, void *data)
-{
-	struct iio_channel **r = res;
-
-	if (!r || !*r) {
-		WARN_ON(!r || !*r);
-		return 0;
-	}
-
-	return *r == data;
-}
-
 struct iio_channel *devm_iio_channel_get(struct device *dev,
 					 const char *channel_name)
 {
@@ -394,13 +382,6 @@ struct iio_channel *devm_iio_channel_get(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(devm_iio_channel_get);
 
-void devm_iio_channel_release(struct device *dev, struct iio_channel *channel)
-{
-	WARN_ON(devres_release(dev, devm_iio_channel_free,
-			       devm_iio_channel_match, channel));
-}
-EXPORT_SYMBOL_GPL(devm_iio_channel_release);
-
 struct iio_channel *iio_channel_get_all(struct device *dev)
 {
 	const char *name;
@@ -514,14 +495,6 @@ struct iio_channel *devm_iio_channel_get_all(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(devm_iio_channel_get_all);
 
-void devm_iio_channel_release_all(struct device *dev,
-				  struct iio_channel *channels)
-{
-	WARN_ON(devres_release(dev, devm_iio_channel_free_all,
-			       devm_iio_channel_match, channels));
-}
-EXPORT_SYMBOL_GPL(devm_iio_channel_release_all);
-
 static int iio_channel_read(struct iio_channel *chan, int *val, int *val2,
 	enum iio_chan_info_enum info)
 {
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 2bde8c912d4d..c4118dcb8e05 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -63,15 +63,6 @@ void iio_channel_release(struct iio_channel *chan);
  */
 struct iio_channel *devm_iio_channel_get(struct device *dev,
 					 const char *consumer_channel);
-/**
- * devm_iio_channel_release() - Resource managed version of
- *				iio_channel_release().
- * @dev:		Pointer to consumer device for which resource
- *			is allocared.
- * @chan:		The channel to be released.
- */
-void devm_iio_channel_release(struct device *dev, struct iio_channel *chan);
-
 /**
  * iio_channel_get_all() - get all channels associated with a client
  * @dev:		Pointer to consumer device.
@@ -106,15 +97,6 @@ void iio_channel_release_all(struct iio_channel *chan);
  */
 struct iio_channel *devm_iio_channel_get_all(struct device *dev);
 
-/**
- * devm_iio_channel_release_all() - Resource managed version of
- *				    iio_channel_release_all().
- * @dev:		Pointer to consumer device for which resource
- *			is allocared.
- * @chan:		Array channel to be released.
- */
-void devm_iio_channel_release_all(struct device *dev, struct iio_channel *chan);
-
 struct iio_cb_buffer;
 /**
  * iio_channel_get_all_cb() - register callback for triggered capture
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 7/8] iio: buffer: drop devm_iio_hw_consumer_free() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
                   ` (4 preceding siblings ...)
  2020-02-27 13:52 ` [PATCH 6/8] iio: inkern: drop devm_iio_channel_release{_all} API calls Alexandru Ardelean
@ 2020-02-27 13:52 ` Alexandru Ardelean
  2020-04-12 13:00   ` Jonathan Cameron
  2020-02-27 13:52 ` [PATCH 8/8] iio: buffer: drop devm_iio_kfifo_free() " Alexandru Ardelean
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

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>
---
 drivers/iio/buffer/industrialio-hw-consumer.c | 31 -------------------
 include/linux/iio/hw-consumer.h               |  1 -
 2 files changed, 32 deletions(-)

diff --git a/drivers/iio/buffer/industrialio-hw-consumer.c b/drivers/iio/buffer/industrialio-hw-consumer.c
index 95165697d8ae..f2d27788f666 100644
--- a/drivers/iio/buffer/industrialio-hw-consumer.c
+++ b/drivers/iio/buffer/industrialio-hw-consumer.c
@@ -142,17 +142,6 @@ static void devm_iio_hw_consumer_release(struct device *dev, void *res)
 	iio_hw_consumer_free(*(struct iio_hw_consumer **)res);
 }
 
-static int devm_iio_hw_consumer_match(struct device *dev, void *res, void *data)
-{
-	struct iio_hw_consumer **r = res;
-
-	if (!r || !*r) {
-		WARN_ON(!r || !*r);
-		return 0;
-	}
-	return *r == data;
-}
-
 /**
  * devm_iio_hw_consumer_alloc - Resource-managed iio_hw_consumer_alloc()
  * @dev: Pointer to consumer device.
@@ -160,9 +149,6 @@ static int devm_iio_hw_consumer_match(struct device *dev, void *res, void *data)
  * Managed iio_hw_consumer_alloc. iio_hw_consumer allocated with this function
  * is automatically freed on driver detach.
  *
- * If an iio_hw_consumer allocated with this function needs to be freed
- * separately, devm_iio_hw_consumer_free() must be used.
- *
  * returns pointer to allocated iio_hw_consumer on success, NULL on failure.
  */
 struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev)
@@ -186,23 +172,6 @@ struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(devm_iio_hw_consumer_alloc);
 
-/**
- * devm_iio_hw_consumer_free - Resource-managed iio_hw_consumer_free()
- * @dev: Pointer to consumer device.
- * @hwc: iio_hw_consumer to free.
- *
- * Free iio_hw_consumer allocated with devm_iio_hw_consumer_alloc().
- */
-void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc)
-{
-	int rc;
-
-	rc = devres_release(dev, devm_iio_hw_consumer_release,
-			    devm_iio_hw_consumer_match, hwc);
-	WARN_ON(rc);
-}
-EXPORT_SYMBOL_GPL(devm_iio_hw_consumer_free);
-
 /**
  * iio_hw_consumer_enable() - Enable IIO hardware consumer
  * @hwc: iio_hw_consumer to enable.
diff --git a/include/linux/iio/hw-consumer.h b/include/linux/iio/hw-consumer.h
index 44d48bb1d39f..e8255c2e33bc 100644
--- a/include/linux/iio/hw-consumer.h
+++ b/include/linux/iio/hw-consumer.h
@@ -14,7 +14,6 @@ struct iio_hw_consumer;
 struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev);
 void iio_hw_consumer_free(struct iio_hw_consumer *hwc);
 struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev);
-void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc);
 int iio_hw_consumer_enable(struct iio_hw_consumer *hwc);
 void iio_hw_consumer_disable(struct iio_hw_consumer *hwc);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 8/8] iio: buffer: drop devm_iio_kfifo_free() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
                   ` (5 preceding siblings ...)
  2020-02-27 13:52 ` [PATCH 7/8] iio: buffer: drop devm_iio_hw_consumer_free() API call Alexandru Ardelean
@ 2020-02-27 13:52 ` Alexandru Ardelean
  2020-04-12 13:01   ` Jonathan Cameron
  2020-03-16  9:09 ` [PATCH 1/8] iio: core: drop devm_iio_device_unregister() " Ardelean, Alexandru
  2020-04-12 11:55 ` Jonathan Cameron
  8 siblings, 1 reply; 19+ messages in thread
From: Alexandru Ardelean @ 2020-02-27 13:52 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

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(-)

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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
                   ` (6 preceding siblings ...)
  2020-02-27 13:52 ` [PATCH 8/8] iio: buffer: drop devm_iio_kfifo_free() " Alexandru Ardelean
@ 2020-03-16  9:09 ` Ardelean, Alexandru
  2020-03-16 11:45   ` Jonathan Cameron
  2020-04-12 11:55 ` Jonathan Cameron
  8 siblings, 1 reply; 19+ messages in thread
From: Ardelean, Alexandru @ 2020-03-16  9:09 UTC (permalink / raw)
  To: linux-kernel, linux-iio; +Cc: jic23

On Thu, 2020-02-27 at 15:52 +0200, Alexandru Ardelean 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.

Any thoughts on this?
I suspect that this may be one of those "I'd like to sit on this for a while"
patchsets?
Which is fine.
But I'm also wondering if this got omitted.

Thanks
Alex

> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
>  .../driver-api/driver-model/devres.rst          |  1 -
>  drivers/iio/industrialio-core.c                 | 17 -----------------
>  include/linux/iio/iio.h                         |  4 ----
>  3 files changed, 22 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst
> b/Documentation/driver-api/driver-model/devres.rst
> index 46c13780994c..0580c64ebdfd 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_free()
>    devm_iio_device_register()
> -  devm_iio_device_unregister()
>    devm_iio_kfifo_allocate()
>    devm_iio_kfifo_free()
>    devm_iio_triggered_buffer_setup()
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 0b14666dff09..e4011f8431f9 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -1823,23 +1823,6 @@ int __devm_iio_device_register(struct device *dev,
> struct iio_dev *indio_dev,
>  }
>  EXPORT_SYMBOL_GPL(__devm_iio_device_register);
>  
> -/**
> - * devm_iio_device_unregister - Resource-managed iio_device_unregister()
> - * @dev:	Device this iio_dev belongs to
> - * @indio_dev:	the iio_dev associated with the device
> - *
> - * Unregister iio_dev registered with devm_iio_device_register().
> - */
> -void devm_iio_device_unregister(struct device *dev, struct iio_dev
> *indio_dev)
> -{
> -	int rc;
> -
> -	rc = devres_release(dev, devm_iio_device_unreg,
> -			    devm_iio_device_match, indio_dev);
> -	WARN_ON(rc);
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_device_unregister);
> -
>  /**
>   * iio_device_claim_direct_mode - Keep device in direct mode
>   * @indio_dev:	the iio_dev associated with the device
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 862ce0019eba..0eb9e8d7ec68 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -591,9 +591,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
>   * calls iio_device_register() internally. Refer to that function for more
>   * information.
>   *
> - * If an iio_dev registered with this function needs to be unregistered
> - * separately, devm_iio_device_unregister() must be used.
> - *
>   * RETURNS:
>   * 0 on success, negative error number on failure.
>   */
> @@ -601,7 +598,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
>  	__devm_iio_device_register((dev), (indio_dev), THIS_MODULE);
>  int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
>  			       struct module *this_mod);
> -void devm_iio_device_unregister(struct device *dev, struct iio_dev
> *indio_dev);
>  int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
>  int iio_device_claim_direct_mode(struct iio_dev *indio_dev);
>  void iio_device_release_direct_mode(struct iio_dev *indio_dev);

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call
  2020-03-16  9:09 ` [PATCH 1/8] iio: core: drop devm_iio_device_unregister() " Ardelean, Alexandru
@ 2020-03-16 11:45   ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-03-16 11:45 UTC (permalink / raw)
  To: Ardelean, Alexandru; +Cc: linux-kernel, linux-iio, jic23

On Mon, 16 Mar 2020 09:09:08 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:

> On Thu, 2020-02-27 at 15:52 +0200, Alexandru Ardelean 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.  
> 
> Any thoughts on this?
> I suspect that this may be one of those "I'd like to sit on this for a while"
> patchsets?
> Which is fine.

Got it in one.   It's both extremely simple and extremely likely to break
someones out of tree driver.  I guessing all the ADI ones are fine though :)

> But I'm also wondering if this got omitted.

Wise to check, it wouldn't be the first time I'd lost a whole
series.

Thanks,

Jonathan



> 
> Thanks
> Alex
> 
> > 
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> >  .../driver-api/driver-model/devres.rst          |  1 -
> >  drivers/iio/industrialio-core.c                 | 17 -----------------
> >  include/linux/iio/iio.h                         |  4 ----
> >  3 files changed, 22 deletions(-)
> > 
> > diff --git a/Documentation/driver-api/driver-model/devres.rst
> > b/Documentation/driver-api/driver-model/devres.rst
> > index 46c13780994c..0580c64ebdfd 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_free()
> >    devm_iio_device_register()
> > -  devm_iio_device_unregister()
> >    devm_iio_kfifo_allocate()
> >    devm_iio_kfifo_free()
> >    devm_iio_triggered_buffer_setup()
> > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> > index 0b14666dff09..e4011f8431f9 100644
> > --- a/drivers/iio/industrialio-core.c
> > +++ b/drivers/iio/industrialio-core.c
> > @@ -1823,23 +1823,6 @@ int __devm_iio_device_register(struct device *dev,
> > struct iio_dev *indio_dev,
> >  }
> >  EXPORT_SYMBOL_GPL(__devm_iio_device_register);
> >  
> > -/**
> > - * devm_iio_device_unregister - Resource-managed iio_device_unregister()
> > - * @dev:	Device this iio_dev belongs to
> > - * @indio_dev:	the iio_dev associated with the device
> > - *
> > - * Unregister iio_dev registered with devm_iio_device_register().
> > - */
> > -void devm_iio_device_unregister(struct device *dev, struct iio_dev
> > *indio_dev)
> > -{
> > -	int rc;
> > -
> > -	rc = devres_release(dev, devm_iio_device_unreg,
> > -			    devm_iio_device_match, indio_dev);
> > -	WARN_ON(rc);
> > -}
> > -EXPORT_SYMBOL_GPL(devm_iio_device_unregister);
> > -
> >  /**
> >   * iio_device_claim_direct_mode - Keep device in direct mode
> >   * @indio_dev:	the iio_dev associated with the device
> > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> > index 862ce0019eba..0eb9e8d7ec68 100644
> > --- a/include/linux/iio/iio.h
> > +++ b/include/linux/iio/iio.h
> > @@ -591,9 +591,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
> >   * calls iio_device_register() internally. Refer to that function for more
> >   * information.
> >   *
> > - * If an iio_dev registered with this function needs to be unregistered
> > - * separately, devm_iio_device_unregister() must be used.
> > - *
> >   * RETURNS:
> >   * 0 on success, negative error number on failure.
> >   */
> > @@ -601,7 +598,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
> >  	__devm_iio_device_register((dev), (indio_dev), THIS_MODULE);
> >  int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
> >  			       struct module *this_mod);
> > -void devm_iio_device_unregister(struct device *dev, struct iio_dev
> > *indio_dev);
> >  int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
> >  int iio_device_claim_direct_mode(struct iio_dev *indio_dev);
> >  void iio_device_release_direct_mode(struct iio_dev *indio_dev);  



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call
  2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
                   ` (7 preceding siblings ...)
  2020-03-16  9:09 ` [PATCH 1/8] iio: core: drop devm_iio_device_unregister() " Ardelean, Alexandru
@ 2020-04-12 11:55 ` Jonathan Cameron
  8 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 11:55 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Thu, 27 Feb 2020 15:52:20 +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>
Time to pick these up I think.  They've sat here a while and no
one has commented + I can't think of any disadvantages.

Hence,

Applied to the togreg  branch of iio.git and pushed out as testing for
the autobuilders to play with them.

Thanks,

Jonathan

> ---
>  .../driver-api/driver-model/devres.rst          |  1 -
>  drivers/iio/industrialio-core.c                 | 17 -----------------
>  include/linux/iio/iio.h                         |  4 ----
>  3 files changed, 22 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index 46c13780994c..0580c64ebdfd 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_free()
>    devm_iio_device_register()
> -  devm_iio_device_unregister()
>    devm_iio_kfifo_allocate()
>    devm_iio_kfifo_free()
>    devm_iio_triggered_buffer_setup()
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 0b14666dff09..e4011f8431f9 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -1823,23 +1823,6 @@ int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
>  }
>  EXPORT_SYMBOL_GPL(__devm_iio_device_register);
>  
> -/**
> - * devm_iio_device_unregister - Resource-managed iio_device_unregister()
> - * @dev:	Device this iio_dev belongs to
> - * @indio_dev:	the iio_dev associated with the device
> - *
> - * Unregister iio_dev registered with devm_iio_device_register().
> - */
> -void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev)
> -{
> -	int rc;
> -
> -	rc = devres_release(dev, devm_iio_device_unreg,
> -			    devm_iio_device_match, indio_dev);
> -	WARN_ON(rc);
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_device_unregister);
> -
>  /**
>   * iio_device_claim_direct_mode - Keep device in direct mode
>   * @indio_dev:	the iio_dev associated with the device
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 862ce0019eba..0eb9e8d7ec68 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -591,9 +591,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
>   * calls iio_device_register() internally. Refer to that function for more
>   * information.
>   *
> - * If an iio_dev registered with this function needs to be unregistered
> - * separately, devm_iio_device_unregister() must be used.
> - *
>   * RETURNS:
>   * 0 on success, negative error number on failure.
>   */
> @@ -601,7 +598,6 @@ void iio_device_unregister(struct iio_dev *indio_dev);
>  	__devm_iio_device_register((dev), (indio_dev), THIS_MODULE);
>  int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
>  			       struct module *this_mod);
> -void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev);
>  int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
>  int iio_device_claim_direct_mode(struct iio_dev *indio_dev);
>  void iio_device_release_direct_mode(struct iio_dev *indio_dev);


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/8] iio: core: drop devm_iio_triggered_buffer_cleanup() API call
  2020-02-27 13:52 ` [PATCH 2/8] iio: core: drop devm_iio_triggered_buffer_cleanup() " Alexandru Ardelean
@ 2020-04-12 12:33   ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 12:33 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Thu, 27 Feb 2020 15:52:21 +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,

Thanks,

J
> ---
>  Documentation/driver-api/driver-model/devres.rst   |  1 -
>  drivers/iio/buffer/industrialio-triggered-buffer.c | 11 -----------
>  include/linux/iio/triggered_buffer.h               |  2 --
>  3 files changed, 14 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index 0580c64ebdfd..1431d5e44abc 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -289,7 +289,6 @@ IIO
>    devm_iio_kfifo_allocate()
>    devm_iio_kfifo_free()
>    devm_iio_triggered_buffer_setup()
> -  devm_iio_triggered_buffer_cleanup()
>    devm_iio_trigger_alloc()
>    devm_iio_trigger_free()
>    devm_iio_trigger_register()
> diff --git a/drivers/iio/buffer/industrialio-triggered-buffer.c b/drivers/iio/buffer/industrialio-triggered-buffer.c
> index cb322b2f09cd..e8046c1ecd6b 100644
> --- a/drivers/iio/buffer/industrialio-triggered-buffer.c
> +++ b/drivers/iio/buffer/industrialio-triggered-buffer.c
> @@ -126,17 +126,6 @@ int devm_iio_triggered_buffer_setup(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(devm_iio_triggered_buffer_setup);
>  
> -void devm_iio_triggered_buffer_cleanup(struct device *dev,
> -				       struct iio_dev *indio_dev)
> -{
> -	int rc;
> -
> -	rc = devres_release(dev, devm_iio_triggered_buffer_clean,
> -			    devm_iio_device_match, indio_dev);
> -	WARN_ON(rc);
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_triggered_buffer_cleanup);
> -
>  MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
>  MODULE_DESCRIPTION("IIO helper functions for setting up triggered buffers");
>  MODULE_LICENSE("GPL");
> diff --git a/include/linux/iio/triggered_buffer.h b/include/linux/iio/triggered_buffer.h
> index 238ad30ce166..e99c91799359 100644
> --- a/include/linux/iio/triggered_buffer.h
> +++ b/include/linux/iio/triggered_buffer.h
> @@ -18,7 +18,5 @@ int devm_iio_triggered_buffer_setup(struct device *dev,
>  				    irqreturn_t (*h)(int irq, void *p),
>  				    irqreturn_t (*thread)(int irq, void *p),
>  				    const struct iio_buffer_setup_ops *ops);
> -void devm_iio_triggered_buffer_cleanup(struct device *dev,
> -				       struct iio_dev *indio_dev);
>  
>  #endif


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/8] iio: core: drop devm_iio_device_free() API call
  2020-02-27 13:52 ` [PATCH 3/8] iio: core: drop devm_iio_device_free() " Alexandru Ardelean
@ 2020-04-12 12:36   ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 12:36 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Thu, 27 Feb 2020 15:52:22 +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.
> 
> This is the last user of 'devm_iio_device_match()', so it can be removed as
> well in this patch.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied.

Thanks,

J
> ---
>  .../driver-api/driver-model/devres.rst        |  1 -
>  drivers/iio/industrialio-core.c               | 31 -------------------
>  include/linux/iio/iio.h                       |  2 --
>  3 files changed, 34 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index 1431d5e44abc..6ae6c67dfec0 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -284,7 +284,6 @@ I2C
>  
>  IIO
>    devm_iio_device_alloc()
> -  devm_iio_device_free()
>    devm_iio_device_register()
>    devm_iio_kfifo_allocate()
>    devm_iio_kfifo_free()
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index e4011f8431f9..ebe338a0494f 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -1539,17 +1539,6 @@ static void devm_iio_device_release(struct device *dev, void *res)
>  	iio_device_free(*(struct iio_dev **)res);
>  }
>  
> -int devm_iio_device_match(struct device *dev, void *res, void *data)
> -{
> -	struct iio_dev **r = res;
> -	if (!r || !*r) {
> -		WARN_ON(!r || !*r);
> -		return 0;
> -	}
> -	return *r == data;
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_device_match);
> -
>  /**
>   * devm_iio_device_alloc - Resource-managed iio_device_alloc()
>   * @dev:		Device to allocate iio_dev for
> @@ -1558,9 +1547,6 @@ EXPORT_SYMBOL_GPL(devm_iio_device_match);
>   * Managed iio_device_alloc. iio_dev allocated with this function is
>   * automatically freed on driver detach.
>   *
> - * If an iio_dev allocated with this function needs to be freed separately,
> - * devm_iio_device_free() must be used.
> - *
>   * RETURNS:
>   * Pointer to allocated iio_dev on success, NULL on failure.
>   */
> @@ -1585,23 +1571,6 @@ struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv)
>  }
>  EXPORT_SYMBOL_GPL(devm_iio_device_alloc);
>  
> -/**
> - * devm_iio_device_free - Resource-managed iio_device_free()
> - * @dev:		Device this iio_dev belongs to
> - * @iio_dev:		the iio_dev associated with the device
> - *
> - * Free iio_dev allocated with devm_iio_device_alloc().
> - */
> -void devm_iio_device_free(struct device *dev, struct iio_dev *iio_dev)
> -{
> -	int rc;
> -
> -	rc = devres_release(dev, devm_iio_device_release,
> -			    devm_iio_device_match, iio_dev);
> -	WARN_ON(rc);
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_device_free);
> -
>  /**
>   * iio_chrdev_open() - chrdev file open for buffer access and ioctls
>   * @inode:	Inode structure for identifying the device in the file system
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 0eb9e8d7ec68..2920c065ab9b 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -686,9 +686,7 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
>  }
>  
>  void iio_device_free(struct iio_dev *indio_dev);
> -int devm_iio_device_match(struct device *dev, void *res, void *data);
>  struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
> -void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
>  struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
>  						const char *fmt, ...);
>  void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/8] iio: core: drop devm_iio_trigger_unregister() API call
  2020-02-27 13:52 ` [PATCH 4/8] iio: core: drop devm_iio_trigger_unregister() " Alexandru Ardelean
@ 2020-04-12 12:51   ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 12:51 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Thu, 27 Feb 2020 15:52:23 +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.

Thanks,

Jonathan

> ---
>  .../driver-api/driver-model/devres.rst        |  1 -
>  Documentation/driver-api/iio/triggers.rst     |  1 -
>  drivers/iio/industrialio-trigger.c            | 21 -------------------
>  include/linux/iio/trigger.h                   |  3 ---
>  4 files changed, 26 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index 6ae6c67dfec0..f638a035e6d2 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -291,7 +291,6 @@ IIO
>    devm_iio_trigger_alloc()
>    devm_iio_trigger_free()
>    devm_iio_trigger_register()
> -  devm_iio_trigger_unregister()
>    devm_iio_channel_get()
>    devm_iio_channel_release()
>    devm_iio_channel_get_all()
> diff --git a/Documentation/driver-api/iio/triggers.rst b/Documentation/driver-api/iio/triggers.rst
> index 5c2156de6284..160faa810d12 100644
> --- a/Documentation/driver-api/iio/triggers.rst
> +++ b/Documentation/driver-api/iio/triggers.rst
> @@ -6,7 +6,6 @@ Triggers
>  * :c:func:`devm_iio_trigger_alloc` — Resource-managed iio_trigger_alloc
>  * :c:func:`devm_iio_trigger_free` — Resource-managed iio_trigger_free
>  * :c:func:`devm_iio_trigger_register` — Resource-managed iio_trigger_register
> -* :c:func:`devm_iio_trigger_unregister` — Resource-managed
>    iio_trigger_unregister
>  * :c:func:`iio_trigger_validate_own_device` — Check if a trigger and IIO
>    device belong to the same device
> diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> index 3908a9a90035..611f608a9da2 100644
> --- a/drivers/iio/industrialio-trigger.c
> +++ b/drivers/iio/industrialio-trigger.c
> @@ -673,9 +673,6 @@ static void devm_iio_trigger_unreg(struct device *dev, void *res)
>   * calls iio_trigger_register() internally. Refer to that function for more
>   * information.
>   *
> - * If an iio_trigger registered with this function needs to be unregistered
> - * separately, devm_iio_trigger_unregister() must be used.
> - *
>   * RETURNS:
>   * 0 on success, negative error number on failure.
>   */
> @@ -701,24 +698,6 @@ int __devm_iio_trigger_register(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(__devm_iio_trigger_register);
>  
> -/**
> - * devm_iio_trigger_unregister - Resource-managed iio_trigger_unregister()
> - * @dev:	device this iio_trigger belongs to
> - * @trig_info:	the trigger associated with the device
> - *
> - * Unregister trigger registered with devm_iio_trigger_register().
> - */
> -void devm_iio_trigger_unregister(struct device *dev,
> -				 struct iio_trigger *trig_info)
> -{
> -	int rc;
> -
> -	rc = devres_release(dev, devm_iio_trigger_unreg, devm_iio_trigger_match,
> -			    trig_info);
> -	WARN_ON(rc);
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_trigger_unregister);
> -
>  bool iio_trigger_using_own(struct iio_dev *indio_dev)
>  {
>  	return indio_dev->trig->attached_own_device;
> diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
> index 84995e2967ac..cad8325903f9 100644
> --- a/include/linux/iio/trigger.h
> +++ b/include/linux/iio/trigger.h
> @@ -141,9 +141,6 @@ int __devm_iio_trigger_register(struct device *dev,
>   **/
>  void iio_trigger_unregister(struct iio_trigger *trig_info);
>  
> -void devm_iio_trigger_unregister(struct device *dev,
> -				 struct iio_trigger *trig_info);
> -
>  /**
>   * iio_trigger_set_immutable() - set an immutable trigger on destination
>   *


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/8] iio: core: drop devm_iio_trigger_free() API call
  2020-02-27 13:52 ` [PATCH 5/8] iio: core: drop devm_iio_trigger_free() " Alexandru Ardelean
@ 2020-04-12 12:57   ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 12:57 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Thu, 27 Feb 2020 15:52:24 +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.  For reasons I'm not sure of the character encoding
on these seems to be messed up.  I'm fixing it by hand, so hopefully
it won't break anything.

Thanks,

Jonathan

> ---
>  .../driver-api/driver-model/devres.rst        |  1 -
>  Documentation/driver-api/iio/triggers.rst     |  1 -
>  drivers/iio/industrialio-trigger.c            | 32 -------------------
>  include/linux/iio/iio.h                       |  2 --
>  4 files changed, 36 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index f638a035e6d2..6c401c74e480 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -289,7 +289,6 @@ IIO
>    devm_iio_kfifo_free()
>    devm_iio_triggered_buffer_setup()
>    devm_iio_trigger_alloc()
> -  devm_iio_trigger_free()
>    devm_iio_trigger_register()
>    devm_iio_channel_get()
>    devm_iio_channel_release()
> diff --git a/Documentation/driver-api/iio/triggers.rst b/Documentation/driver-api/iio/triggers.rst
> index 160faa810d12..dfd7ba3eabde 100644
> --- a/Documentation/driver-api/iio/triggers.rst
> +++ b/Documentation/driver-api/iio/triggers.rst
> @@ -4,7 +4,6 @@ Triggers
>  
>  * struct :c:type:`iio_trigger` — industrial I/O trigger device
>  * :c:func:`devm_iio_trigger_alloc` — Resource-managed iio_trigger_alloc
> -* :c:func:`devm_iio_trigger_free` — Resource-managed iio_trigger_free
>  * :c:func:`devm_iio_trigger_register` — Resource-managed iio_trigger_register
>    iio_trigger_unregister
>  * :c:func:`iio_trigger_validate_own_device` — Check if a trigger and IIO
> diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> index 611f608a9da2..53d1931f6be8 100644
> --- a/drivers/iio/industrialio-trigger.c
> +++ b/drivers/iio/industrialio-trigger.c
> @@ -585,18 +585,6 @@ static void devm_iio_trigger_release(struct device *dev, void *res)
>  	iio_trigger_free(*(struct iio_trigger **)res);
>  }
>  
> -static int devm_iio_trigger_match(struct device *dev, void *res, void *data)
> -{
> -	struct iio_trigger **r = res;
> -
> -	if (!r || !*r) {
> -		WARN_ON(!r || !*r);
> -		return 0;
> -	}
> -
> -	return *r == data;
> -}
> -
>  /**
>   * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc()
>   * @dev:		Device to allocate iio_trigger for
> @@ -608,9 +596,6 @@ static int devm_iio_trigger_match(struct device *dev, void *res, void *data)
>   * Managed iio_trigger_alloc.  iio_trigger allocated with this function is
>   * automatically freed on driver detach.
>   *
> - * If an iio_trigger allocated with this function needs to be freed separately,
> - * devm_iio_trigger_free() must be used.
> - *
>   * RETURNS:
>   * Pointer to allocated iio_trigger on success, NULL on failure.
>   */
> @@ -640,23 +625,6 @@ struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(devm_iio_trigger_alloc);
>  
> -/**
> - * devm_iio_trigger_free - Resource-managed iio_trigger_free()
> - * @dev:		Device this iio_dev belongs to
> - * @iio_trig:		the iio_trigger associated with the device
> - *
> - * Free iio_trigger allocated with devm_iio_trigger_alloc().
> - */
> -void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig)
> -{
> -	int rc;
> -
> -	rc = devres_release(dev, devm_iio_trigger_release,
> -			    devm_iio_trigger_match, iio_trig);
> -	WARN_ON(rc);
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_trigger_free);
> -
>  static void devm_iio_trigger_unreg(struct device *dev, void *res)
>  {
>  	iio_trigger_unregister(*(struct iio_trigger **)res);
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 2920c065ab9b..1a5d3d630ec1 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -689,8 +689,6 @@ void iio_device_free(struct iio_dev *indio_dev);
>  struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
>  struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
>  						const char *fmt, ...);
> -void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
> -
>  /**
>   * iio_buffer_enabled() - helper function to test if the buffer is enabled
>   * @indio_dev:		IIO device structure for device


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/8] iio: inkern: drop devm_iio_channel_release{_all} API calls
  2020-02-27 13:52 ` [PATCH 6/8] iio: inkern: drop devm_iio_channel_release{_all} API calls Alexandru Ardelean
@ 2020-04-12 12:58   ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 12:58 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Thu, 27 Feb 2020 15:52:25 +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.

Thanks,

Jonathan

> ---
>  .../driver-api/driver-model/devres.rst        |  2 --
>  drivers/iio/inkern.c                          | 27 -------------------
>  include/linux/iio/consumer.h                  | 18 -------------
>  3 files changed, 47 deletions(-)
> 
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index 6c401c74e480..10ccebe9f7c1 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -291,9 +291,7 @@ IIO
>    devm_iio_trigger_alloc()
>    devm_iio_trigger_register()
>    devm_iio_channel_get()
> -  devm_iio_channel_release()
>    devm_iio_channel_get_all()
> -  devm_iio_channel_release_all()
>  
>  INPUT
>    devm_input_allocate_device()
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index 5a8351c9a426..ede99e0d5371 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -360,18 +360,6 @@ static void devm_iio_channel_free(struct device *dev, void *res)
>  	iio_channel_release(channel);
>  }
>  
> -static int devm_iio_channel_match(struct device *dev, void *res, void *data)
> -{
> -	struct iio_channel **r = res;
> -
> -	if (!r || !*r) {
> -		WARN_ON(!r || !*r);
> -		return 0;
> -	}
> -
> -	return *r == data;
> -}
> -
>  struct iio_channel *devm_iio_channel_get(struct device *dev,
>  					 const char *channel_name)
>  {
> @@ -394,13 +382,6 @@ struct iio_channel *devm_iio_channel_get(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(devm_iio_channel_get);
>  
> -void devm_iio_channel_release(struct device *dev, struct iio_channel *channel)
> -{
> -	WARN_ON(devres_release(dev, devm_iio_channel_free,
> -			       devm_iio_channel_match, channel));
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_channel_release);
> -
>  struct iio_channel *iio_channel_get_all(struct device *dev)
>  {
>  	const char *name;
> @@ -514,14 +495,6 @@ struct iio_channel *devm_iio_channel_get_all(struct device *dev)
>  }
>  EXPORT_SYMBOL_GPL(devm_iio_channel_get_all);
>  
> -void devm_iio_channel_release_all(struct device *dev,
> -				  struct iio_channel *channels)
> -{
> -	WARN_ON(devres_release(dev, devm_iio_channel_free_all,
> -			       devm_iio_channel_match, channels));
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_channel_release_all);
> -
>  static int iio_channel_read(struct iio_channel *chan, int *val, int *val2,
>  	enum iio_chan_info_enum info)
>  {
> diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
> index 2bde8c912d4d..c4118dcb8e05 100644
> --- a/include/linux/iio/consumer.h
> +++ b/include/linux/iio/consumer.h
> @@ -63,15 +63,6 @@ void iio_channel_release(struct iio_channel *chan);
>   */
>  struct iio_channel *devm_iio_channel_get(struct device *dev,
>  					 const char *consumer_channel);
> -/**
> - * devm_iio_channel_release() - Resource managed version of
> - *				iio_channel_release().
> - * @dev:		Pointer to consumer device for which resource
> - *			is allocared.
> - * @chan:		The channel to be released.
> - */
> -void devm_iio_channel_release(struct device *dev, struct iio_channel *chan);
> -
>  /**
>   * iio_channel_get_all() - get all channels associated with a client
>   * @dev:		Pointer to consumer device.
> @@ -106,15 +97,6 @@ void iio_channel_release_all(struct iio_channel *chan);
>   */
>  struct iio_channel *devm_iio_channel_get_all(struct device *dev);
>  
> -/**
> - * devm_iio_channel_release_all() - Resource managed version of
> - *				    iio_channel_release_all().
> - * @dev:		Pointer to consumer device for which resource
> - *			is allocared.
> - * @chan:		Array channel to be released.
> - */
> -void devm_iio_channel_release_all(struct device *dev, struct iio_channel *chan);
> -
>  struct iio_cb_buffer;
>  /**
>   * iio_channel_get_all_cb() - register callback for triggered capture


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/8] iio: buffer: drop devm_iio_hw_consumer_free() API call
  2020-02-27 13:52 ` [PATCH 7/8] iio: buffer: drop devm_iio_hw_consumer_free() API call Alexandru Ardelean
@ 2020-04-12 13:00   ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 13:00 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Thu, 27 Feb 2020 15:52:26 +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 thanks.

Though just notice you have a can't where it should be can in the patch
description.   Will fix that up.

Thanks,

Jonathan

> ---
>  drivers/iio/buffer/industrialio-hw-consumer.c | 31 -------------------
>  include/linux/iio/hw-consumer.h               |  1 -
>  2 files changed, 32 deletions(-)
> 
> diff --git a/drivers/iio/buffer/industrialio-hw-consumer.c b/drivers/iio/buffer/industrialio-hw-consumer.c
> index 95165697d8ae..f2d27788f666 100644
> --- a/drivers/iio/buffer/industrialio-hw-consumer.c
> +++ b/drivers/iio/buffer/industrialio-hw-consumer.c
> @@ -142,17 +142,6 @@ static void devm_iio_hw_consumer_release(struct device *dev, void *res)
>  	iio_hw_consumer_free(*(struct iio_hw_consumer **)res);
>  }
>  
> -static int devm_iio_hw_consumer_match(struct device *dev, void *res, void *data)
> -{
> -	struct iio_hw_consumer **r = res;
> -
> -	if (!r || !*r) {
> -		WARN_ON(!r || !*r);
> -		return 0;
> -	}
> -	return *r == data;
> -}
> -
>  /**
>   * devm_iio_hw_consumer_alloc - Resource-managed iio_hw_consumer_alloc()
>   * @dev: Pointer to consumer device.
> @@ -160,9 +149,6 @@ static int devm_iio_hw_consumer_match(struct device *dev, void *res, void *data)
>   * Managed iio_hw_consumer_alloc. iio_hw_consumer allocated with this function
>   * is automatically freed on driver detach.
>   *
> - * If an iio_hw_consumer allocated with this function needs to be freed
> - * separately, devm_iio_hw_consumer_free() must be used.
> - *
>   * returns pointer to allocated iio_hw_consumer on success, NULL on failure.
>   */
>  struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev)
> @@ -186,23 +172,6 @@ struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev)
>  }
>  EXPORT_SYMBOL_GPL(devm_iio_hw_consumer_alloc);
>  
> -/**
> - * devm_iio_hw_consumer_free - Resource-managed iio_hw_consumer_free()
> - * @dev: Pointer to consumer device.
> - * @hwc: iio_hw_consumer to free.
> - *
> - * Free iio_hw_consumer allocated with devm_iio_hw_consumer_alloc().
> - */
> -void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc)
> -{
> -	int rc;
> -
> -	rc = devres_release(dev, devm_iio_hw_consumer_release,
> -			    devm_iio_hw_consumer_match, hwc);
> -	WARN_ON(rc);
> -}
> -EXPORT_SYMBOL_GPL(devm_iio_hw_consumer_free);
> -
>  /**
>   * iio_hw_consumer_enable() - Enable IIO hardware consumer
>   * @hwc: iio_hw_consumer to enable.
> diff --git a/include/linux/iio/hw-consumer.h b/include/linux/iio/hw-consumer.h
> index 44d48bb1d39f..e8255c2e33bc 100644
> --- a/include/linux/iio/hw-consumer.h
> +++ b/include/linux/iio/hw-consumer.h
> @@ -14,7 +14,6 @@ struct iio_hw_consumer;
>  struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev);
>  void iio_hw_consumer_free(struct iio_hw_consumer *hwc);
>  struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev);
> -void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc);
>  int iio_hw_consumer_enable(struct iio_hw_consumer *hwc);
>  void iio_hw_consumer_disable(struct iio_hw_consumer *hwc);
>  


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 8/8] iio: buffer: drop devm_iio_kfifo_free() API call
  2020-02-27 13:52 ` [PATCH 8/8] iio: buffer: drop devm_iio_kfifo_free() " Alexandru Ardelean
@ 2020-04-12 13:01   ` Jonathan Cameron
  2020-04-12 14:21     ` Ardelean, Alexandru
  0 siblings, 1 reply; 19+ messages in thread
From: Jonathan Cameron @ 2020-04-12 13:01 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 8/8] iio: buffer: drop devm_iio_kfifo_free() API call
  2020-04-12 13:01   ` Jonathan Cameron
@ 2020-04-12 14:21     ` Ardelean, Alexandru
  0 siblings, 0 replies; 19+ messages in thread
From: Ardelean, Alexandru @ 2020-04-12 14:21 UTC (permalink / raw)
  To: jic23; +Cc: linux-kernel, linux-iio

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-04-12 14:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 13:52 [PATCH 1/8] iio: core: drop devm_iio_device_unregister() API call Alexandru Ardelean
2020-02-27 13:52 ` [PATCH 2/8] iio: core: drop devm_iio_triggered_buffer_cleanup() " Alexandru Ardelean
2020-04-12 12:33   ` Jonathan Cameron
2020-02-27 13:52 ` [PATCH 3/8] iio: core: drop devm_iio_device_free() " Alexandru Ardelean
2020-04-12 12:36   ` Jonathan Cameron
2020-02-27 13:52 ` [PATCH 4/8] iio: core: drop devm_iio_trigger_unregister() " Alexandru Ardelean
2020-04-12 12:51   ` Jonathan Cameron
2020-02-27 13:52 ` [PATCH 5/8] iio: core: drop devm_iio_trigger_free() " Alexandru Ardelean
2020-04-12 12:57   ` Jonathan Cameron
2020-02-27 13:52 ` [PATCH 6/8] iio: inkern: drop devm_iio_channel_release{_all} API calls Alexandru Ardelean
2020-04-12 12:58   ` Jonathan Cameron
2020-02-27 13:52 ` [PATCH 7/8] iio: buffer: drop devm_iio_hw_consumer_free() API call Alexandru Ardelean
2020-04-12 13:00   ` Jonathan Cameron
2020-02-27 13:52 ` [PATCH 8/8] iio: buffer: drop devm_iio_kfifo_free() " Alexandru Ardelean
2020-04-12 13:01   ` Jonathan Cameron
2020-04-12 14:21     ` Ardelean, Alexandru
2020-03-16  9:09 ` [PATCH 1/8] iio: core: drop devm_iio_device_unregister() " Ardelean, Alexandru
2020-03-16 11:45   ` Jonathan Cameron
2020-04-12 11:55 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).