linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karol Wrona <k.wrona@samsung.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	linux-kernel@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Karol Wrona <wrona.vy@gmail.com>
Subject: Re: [PATCH 1/2] iio: Add no-triggered buffer helper functions
Date: Mon, 12 Jan 2015 10:31:30 +0100	[thread overview]
Message-ID: <54B39472.4000303@samsung.com> (raw)
In-Reply-To: <54B16DD3.3030505@kernel.org>

On 01/10/2015 07:22 PM, Jonathan Cameron wrote:
> On 10/01/15 11:10, Lars-Peter Clausen wrote:
>> On 01/08/2015 05:40 PM, Karol Wrona wrote:
>>> These ones helps to create and manage iio_kfifo buffer when
>>> no-triggered buffer is used.
>> [...]
>>> +int iio_notriggered_buffer_setup(struct iio_dev *indio_dev,
>>> +                 const struct iio_buffer_setup_ops *setup_ops)
>>> +
>>> +{
>>> +    int ret;
>>> +    struct iio_buffer *buffer;
>>> +
>>> +    buffer = iio_kfifo_allocate();
>>> +    if (!buffer)
>>> +        return -ENOMEM;
>>> +
>>> +    iio_device_attach_buffer(indio_dev, buffer);
>>> +
>>> +    indio_dev->setup_ops = setup_ops;
>>> +
>>> +    ret = iio_buffer_register(indio_dev, indio_dev->channels,
>>> +                  indio_dev->num_channels);
>>> +    if (ret)
>>> +        iio_kfifo_free(buffer);
>>> +
>>
>> We recently got rid of having to manually call iio_buffer_register() and iio_buffer_unregister(). This is now done by the IIO core. See http://git.kernel.org/cgit/linux/kernel/git/jic23/iio.git/commit/?h=togreg&id=3e1b6c95b990c93f4aa3b17e9f66221e2fa44bee
>>
>> I don't think we actually need these non-triggered helper functions anymore. It basically just boils down to iio_kfifo_allocate() and iio_device_attach_buffer().
>>
> Even if they are still worthwhile, I'd just put them in the core code rather
> than having the additional module.  Too trivial for it to make sense
> in a utility module.
> 
> I'm inclined to agree with Lars that the recent changes reduce the argument for
> having these to marginal at best.  Bad luck for crossing with those!
> 
> Jonathan
> 
> J
>> - Lars

No problem with dropping that. I prefer to be done this way too as now cleanup
wrapper has no sense at all.

Thanks
Karol


>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2015-01-12  9:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 16:40 [PATCH 0/2] iio: Add no-triggered buffer helper functions Karol Wrona
2015-01-08 16:40 ` [PATCH 1/2] " Karol Wrona
2015-01-10 11:10   ` Lars-Peter Clausen
2015-01-10 18:22     ` Jonathan Cameron
2015-01-12  9:31       ` Karol Wrona [this message]
2015-01-08 16:40 ` [PATCH 2/2] iio: Deselect IIO_TRIGGER for IIO_KFIFO_BUF Karol Wrona
2015-01-10 11:11   ` Lars-Peter Clausen
2015-01-10 18:19     ` 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=54B39472.4000303@samsung.com \
    --to=k.wrona@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=kyungmin.park@samsung.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=wrona.vy@gmail.com \
    /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 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).