All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>, linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/9] staging:iio: Add helper function for initializing triggered buffers
Date: Fri, 08 Jun 2012 09:47:20 +0200	[thread overview]
Message-ID: <4FD1AE08.3080602@metafoo.de> (raw)
In-Reply-To: <4FD0FC70.2060906@kernel.org>

On 06/07/2012 09:09 PM, Jonathan Cameron wrote:
> On 06/06/2012 12:55 PM, Lars-Peter Clausen wrote:
>> Add a helper function for executing the common tasks which are usually involved
>> in setting up a simple triggered buffer. It will allocate the buffer, allocate
>> the pollfunc and register the buffer.
> 
> Hi Lars-Peter,
> 
> Sorry for the delay in reviewing this.
> 
I usually need longer to respond than you do, so no problem.

> I'm not entirely sure how this will stand in the long run but the stats
> speak for themselves...
> 
> Pain that it has to be yet another module but your logic is sound.
> Perhaps naming it industrialio-triggered-buffer-helper might
> make it's purpose a tiny bit clearer?

Yeah, I had that name going through my mind as well but decided against it,
because it is rather long.

> 
> Otherwise, this needs it's own header for point of view of code
> separation (as it's a separate module).

Yep, already had that on my todolist for v2.

> 
> Beyond that fine by me.

Thanks.

> 
> [...]
>> diff --git a/drivers/iio/industrialio-triggered-buffer.c b/drivers/iio/industrialio-triggered-buffer.c
>> new file mode 100644
>> index 0000000..653ebe5
>> --- /dev/null
>> +++ b/drivers/iio/industrialio-triggered-buffer.c
[...]
>> +/**
>> + * iio_triggered_buffer_setup() - Setup simple software ringbuffer and pollfunc
>> + * @indio_dev:		IIO device structure
>> + * @pollfunc_bh:	Function which will be used as pollfunc bottom half
>> + * @pollfunc_th:	Function which will be used as pollfunc top half
>> + * @setup_ops:		Buffer setup functions to use for this device.
>> + *			If NULL the default setup functions for triggered
>> + *			buffers will be used.
>> + *
>> + * This function combines some common tasks which will normally be performed
>> + * when setting up a triggered buffer. It will allocate the buffer and the
>> + * pollfunc, as well as register the buffer with IIO core.
>> + *
>> + * Before calling this function the indio_dev structure should already be
>> + * completly initzialized but not yet registered.
> I'd rather you listed exactly what needs to have happened.
> iio_device_alloc I think...

Everything needs to have happened, except for iio_device_register. I'll add
a sentence which that the function should be called right before
iio_device_register.

  reply	other threads:[~2012-06-08  7:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 11:55 [PATCH 0/9] iio: Add helper function for initializing triggered buffers Lars-Peter Clausen
2012-06-06 11:55 ` [PATCH 1/9] staging:iio: " Lars-Peter Clausen
2012-06-07 19:09   ` Jonathan Cameron
2012-06-08  7:47     ` Lars-Peter Clausen [this message]
2012-06-06 11:55 ` [PATCH 2/9] iio:adc:at91: Use new triggered buffer setup helper Lars-Peter Clausen
2012-06-07 20:02   ` Jonathan Cameron
2012-06-08  7:57     ` Lars-Peter Clausen
2012-06-08  7:59       ` Jonathan Cameron
2012-06-06 11:55 ` [PATCH 3/9] staging:iio:adc:ad7192: Use new triggered buffer setup helper function Lars-Peter Clausen
2012-06-07 20:06   ` Jonathan Cameron
2012-06-06 11:55 ` [PATCH 4/9] staging:iio:adc:ad7298: " Lars-Peter Clausen
2012-06-07 20:11   ` Jonathan Cameron
2012-06-06 11:55 ` [PATCH 5/9] staging:iio:adc:ad7476: " Lars-Peter Clausen
2012-06-07 20:12   ` Jonathan Cameron
2012-06-06 11:55 ` [PATCH 6/9] staging:iio:adc:ad7606: " Lars-Peter Clausen
2012-06-07 20:13   ` Jonathan Cameron
2012-06-07 20:14     ` Jonathan Cameron
2012-06-06 11:55 ` [PATCH 7/9] staging:iio:adc:ad7793: " Lars-Peter Clausen
2012-06-07 20:14   ` Jonathan Cameron
2012-06-06 11:55 ` [PATCH 8/9] staging:iio:adc:ad7887: " Lars-Peter Clausen
2012-06-07 20:15   ` Jonathan Cameron
2012-06-06 11:55 ` [PATCH 9/9] staging:iio:adc:ad799x: " Lars-Peter Clausen
2012-06-07 20:18   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD1AE08.3080602@metafoo.de \
    --to=lars@metafoo.de \
    --cc=jic23@cam.ac.uk \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.