Commit 7ab374a0 authored by Karol Wrona's avatar Karol Wrona Committed by Jonathan Cameron

iio: kfifo: Remove unused argument in iio_kfifo_allocate

indio_dev was unused in function body plus some small style fix - add new
lines after "if(sth) return sth" and before the last return statement.

The argument was removed also in its client.
Signed-off-by: default avatarKarol Wrona <k.wrona@samsung.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 614e8842
...@@ -250,7 +250,7 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev, ...@@ -250,7 +250,7 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev,
struct iio_buffer *buffer; struct iio_buffer *buffer;
int ret; int ret;
buffer = iio_kfifo_allocate(indio_dev); buffer = iio_kfifo_allocate();
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
......
...@@ -49,7 +49,7 @@ int iio_triggered_buffer_setup(struct iio_dev *indio_dev, ...@@ -49,7 +49,7 @@ int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
struct iio_buffer *buffer; struct iio_buffer *buffer;
int ret; int ret;
buffer = iio_kfifo_allocate(indio_dev); buffer = iio_kfifo_allocate();
if (!buffer) { if (!buffer) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_ret; goto error_ret;
......
...@@ -140,18 +140,20 @@ static const struct iio_buffer_access_funcs kfifo_access_funcs = { ...@@ -140,18 +140,20 @@ static const struct iio_buffer_access_funcs kfifo_access_funcs = {
.release = &iio_kfifo_buffer_release, .release = &iio_kfifo_buffer_release,
}; };
struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev) struct iio_buffer *iio_kfifo_allocate(void)
{ {
struct iio_kfifo *kf; struct iio_kfifo *kf;
kf = kzalloc(sizeof *kf, GFP_KERNEL); kf = kzalloc(sizeof(*kf), GFP_KERNEL);
if (!kf) if (!kf)
return NULL; return NULL;
kf->update_needed = true; kf->update_needed = true;
iio_buffer_init(&kf->buffer); iio_buffer_init(&kf->buffer);
kf->buffer.access = &kfifo_access_funcs; kf->buffer.access = &kfifo_access_funcs;
kf->buffer.length = 2; kf->buffer.length = 2;
mutex_init(&kf->user_lock); mutex_init(&kf->user_lock);
return &kf->buffer; return &kf->buffer;
} }
EXPORT_SYMBOL(iio_kfifo_allocate); EXPORT_SYMBOL(iio_kfifo_allocate);
......
...@@ -393,7 +393,7 @@ int lis3l02dq_configure_buffer(struct iio_dev *indio_dev) ...@@ -393,7 +393,7 @@ int lis3l02dq_configure_buffer(struct iio_dev *indio_dev)
int ret; int ret;
struct iio_buffer *buffer; struct iio_buffer *buffer;
buffer = iio_kfifo_allocate(indio_dev); buffer = iio_kfifo_allocate();
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
......
...@@ -121,7 +121,7 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev) ...@@ -121,7 +121,7 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
struct iio_buffer *buffer; struct iio_buffer *buffer;
/* Allocate a buffer to use - here a kfifo */ /* Allocate a buffer to use - here a kfifo */
buffer = iio_kfifo_allocate(indio_dev); buffer = iio_kfifo_allocate();
if (buffer == NULL) { if (buffer == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_ret; goto error_ret;
......
...@@ -626,7 +626,7 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev) ...@@ -626,7 +626,7 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev)
{ {
struct iio_buffer *buffer; struct iio_buffer *buffer;
buffer = iio_kfifo_allocate(indio_dev); buffer = iio_kfifo_allocate();
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
......
...@@ -119,7 +119,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev) ...@@ -119,7 +119,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev)
struct iio_buffer *buffer; struct iio_buffer *buffer;
int ret = 0; int ret = 0;
buffer = iio_kfifo_allocate(indio_dev); buffer = iio_kfifo_allocate();
if (!buffer) { if (!buffer) {
ret = -ENOMEM; ret = -ENOMEM;
return ret; return ret;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/buffer.h> #include <linux/iio/buffer.h>
struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); struct iio_buffer *iio_kfifo_allocate(void);
void iio_kfifo_free(struct iio_buffer *r); void iio_kfifo_free(struct iio_buffer *r);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment