diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-04-26 07:35:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-29 21:23:49 -0400 |
commit | 7cbb753701d11f3c71e8543e1ae0fc0772edac06 (patch) | |
tree | 53954c72751f1842d8565aff3a1ca1b71826603a /include | |
parent | 5d4a6789d5957a6388ea86c811d7c09bbe5f8ebd (diff) |
staging:iio: Streamline API function naming
Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.
In particular the following renames are performed by the patch:
iio_put_device -> iio_device_put
iio_allocate_device -> iio_device_alloc
iio_free_device -> iio_device_free
iio_get_trigger -> iio_trigger_get
iio_put_trigger -> iio_trigger_put
iio_allocate_trigger -> iio_trigger_alloc
iio_free_trigger -> iio_trigger_free
The conversion was done with the following coccinelle patch with manual fixes to
comments and documentation.
<smpl>
@@
@@
-iio_put_device
+iio_device_put
@@
@@
-iio_allocate_device
+iio_device_alloc
@@
@@
-iio_free_device
+iio_device_free
@@
@@
-iio_get_trigger
+iio_trigger_get
@@
@@
-iio_put_trigger
+iio_trigger_put
@@
@@
-iio_allocate_trigger
+iio_trigger_alloc
@@
@@
-iio_free_trigger
+iio_trigger_free
</smpl>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/iio/iio.h | 12 | ||||
-rw-r--r-- | include/linux/iio/trigger.h | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 9c0908a70466..d21833909327 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -400,10 +400,10 @@ int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); | |||
400 | extern struct bus_type iio_bus_type; | 400 | extern struct bus_type iio_bus_type; |
401 | 401 | ||
402 | /** | 402 | /** |
403 | * iio_put_device() - reference counted deallocation of struct device | 403 | * iio_device_put() - reference counted deallocation of struct device |
404 | * @dev: the iio_device containing the device | 404 | * @dev: the iio_device containing the device |
405 | **/ | 405 | **/ |
406 | static inline void iio_put_device(struct iio_dev *indio_dev) | 406 | static inline void iio_device_put(struct iio_dev *indio_dev) |
407 | { | 407 | { |
408 | if (indio_dev) | 408 | if (indio_dev) |
409 | put_device(&indio_dev->dev); | 409 | put_device(&indio_dev->dev); |
@@ -412,10 +412,10 @@ static inline void iio_put_device(struct iio_dev *indio_dev) | |||
412 | /* Can we make this smaller? */ | 412 | /* Can we make this smaller? */ |
413 | #define IIO_ALIGN L1_CACHE_BYTES | 413 | #define IIO_ALIGN L1_CACHE_BYTES |
414 | /** | 414 | /** |
415 | * iio_allocate_device() - allocate an iio_dev from a driver | 415 | * iio_device_alloc() - allocate an iio_dev from a driver |
416 | * @sizeof_priv: Space to allocate for private structure. | 416 | * @sizeof_priv: Space to allocate for private structure. |
417 | **/ | 417 | **/ |
418 | struct iio_dev *iio_allocate_device(int sizeof_priv); | 418 | struct iio_dev *iio_device_alloc(int sizeof_priv); |
419 | 419 | ||
420 | static inline void *iio_priv(const struct iio_dev *indio_dev) | 420 | static inline void *iio_priv(const struct iio_dev *indio_dev) |
421 | { | 421 | { |
@@ -429,10 +429,10 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv) | |||
429 | } | 429 | } |
430 | 430 | ||
431 | /** | 431 | /** |
432 | * iio_free_device() - free an iio_dev from a driver | 432 | * iio_device_free() - free an iio_dev from a driver |
433 | * @dev: the iio_dev associated with the device | 433 | * @dev: the iio_dev associated with the device |
434 | **/ | 434 | **/ |
435 | void iio_free_device(struct iio_dev *indio_dev); | 435 | void iio_device_free(struct iio_dev *indio_dev); |
436 | 436 | ||
437 | /** | 437 | /** |
438 | * iio_buffer_enabled() - helper function to test if the buffer is enabled | 438 | * iio_buffer_enabled() - helper function to test if the buffer is enabled |
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 1cfca231db8f..a9819940a84c 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
@@ -78,13 +78,13 @@ static inline struct iio_trigger *to_iio_trigger(struct device *d) | |||
78 | return container_of(d, struct iio_trigger, dev); | 78 | return container_of(d, struct iio_trigger, dev); |
79 | }; | 79 | }; |
80 | 80 | ||
81 | static inline void iio_put_trigger(struct iio_trigger *trig) | 81 | static inline void iio_trigger_put(struct iio_trigger *trig) |
82 | { | 82 | { |
83 | module_put(trig->ops->owner); | 83 | module_put(trig->ops->owner); |
84 | put_device(&trig->dev); | 84 | put_device(&trig->dev); |
85 | }; | 85 | }; |
86 | 86 | ||
87 | static inline void iio_get_trigger(struct iio_trigger *trig) | 87 | static inline void iio_trigger_get(struct iio_trigger *trig) |
88 | { | 88 | { |
89 | get_device(&trig->dev); | 89 | get_device(&trig->dev); |
90 | __module_get(trig->ops->owner); | 90 | __module_get(trig->ops->owner); |
@@ -113,7 +113,7 @@ void iio_trigger_poll_chained(struct iio_trigger *trig, s64 time); | |||
113 | 113 | ||
114 | irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); | 114 | irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); |
115 | 115 | ||
116 | __printf(1, 2) struct iio_trigger *iio_allocate_trigger(const char *fmt, ...); | 116 | __printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...); |
117 | void iio_free_trigger(struct iio_trigger *trig); | 117 | void iio_trigger_free(struct iio_trigger *trig); |
118 | 118 | ||
119 | #endif /* _IIO_TRIGGER_H_ */ | 119 | #endif /* _IIO_TRIGGER_H_ */ |