linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 07/11] iio: Remove get_bytes_per_datum() from iio_buffer_access_funcs
Date: Fri, 12 Dec 2014 10:51:27 +0000	[thread overview]
Message-ID: <548AC8AF.4080908@kernel.org> (raw)
In-Reply-To: <1417024517-7564-8-git-send-email-lars@metafoo.de>

On 26/11/14 17:55, Lars-Peter Clausen wrote:
> There haven't been any users of the get_bytes_per_datum() callback for a
> while. The core assumes that the number of bytes per datum can be calculated
> based on the enabled channels and the storage size of the channel and
> iio_compute_scan_bytes() is used to compute this number. So remove the
> callback.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to the togreg branch of iio.git - etc etc.
> ---
>  drivers/iio/kfifo_buf.c                    | 6 ------
>  drivers/staging/iio/Documentation/ring.txt | 4 ++--
>  drivers/staging/iio/accel/sca3000_ring.c   | 7 -------
>  include/linux/iio/buffer.h                 | 2 --
>  4 files changed, 2 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c
> index 7134e8a..1258b4e 100644
> --- a/drivers/iio/kfifo_buf.c
> +++ b/drivers/iio/kfifo_buf.c
> @@ -66,11 +66,6 @@ static struct attribute_group iio_kfifo_attribute_group = {
>  	.name = "buffer",
>  };
>  
> -static int iio_get_bytes_per_datum_kfifo(struct iio_buffer *r)
> -{
> -	return r->bytes_per_datum;
> -}
> -
>  static int iio_mark_update_needed_kfifo(struct iio_buffer *r)
>  {
>  	struct iio_kfifo *kf = iio_to_kfifo(r);
> @@ -159,7 +154,6 @@ static const struct iio_buffer_access_funcs kfifo_access_funcs = {
>  	.read_first_n = &iio_read_first_n_kfifo,
>  	.data_available = iio_kfifo_buf_data_available,
>  	.request_update = &iio_request_update_kfifo,
> -	.get_bytes_per_datum = &iio_get_bytes_per_datum_kfifo,
>  	.set_bytes_per_datum = &iio_set_bytes_per_datum_kfifo,
>  	.get_length = &iio_get_length_kfifo,
>  	.set_length = &iio_set_length_kfifo,
> diff --git a/drivers/staging/iio/Documentation/ring.txt b/drivers/staging/iio/Documentation/ring.txt
> index e1da433..434d63a 100644
> --- a/drivers/staging/iio/Documentation/ring.txt
> +++ b/drivers/staging/iio/Documentation/ring.txt
> @@ -39,8 +39,8 @@ request_update
>    If parameters have changed that require reinitialization or configuration of
>    the buffer this will trigger it.
>  
> -get_bytes_per_datum, set_bytes_per_datum
> -  Get/set the number of bytes for a complete scan. (All samples + timestamp)
> +set_bytes_per_datum
> +  Set the number of bytes for a complete scan. (All samples + timestamp)
>  
>  get_length / set_length
>    Get/set the number of complete scans that may be held by the buffer.
> diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c
> index 1578276..aa0e5d8 100644
> --- a/drivers/staging/iio/accel/sca3000_ring.c
> +++ b/drivers/staging/iio/accel/sca3000_ring.c
> @@ -135,12 +135,6 @@ static int sca3000_ring_get_length(struct iio_buffer *r)
>  	return 64;
>  }
>  
> -/* only valid if resolution is kept at 11bits */
> -static int sca3000_ring_get_bytes_per_datum(struct iio_buffer *r)
> -{
> -	return 6;
> -}
> -
>  static bool sca3000_ring_buf_data_available(struct iio_buffer *r)
>  {
>  	return r->stufftoread;
> @@ -278,7 +272,6 @@ static void sca3000_ring_release(struct iio_buffer *r)
>  static const struct iio_buffer_access_funcs sca3000_ring_access_funcs = {
>  	.read_first_n = &sca3000_read_first_n_hw_rb,
>  	.get_length = &sca3000_ring_get_length,
> -	.get_bytes_per_datum = &sca3000_ring_get_bytes_per_datum,
>  	.data_available = sca3000_ring_buf_data_available,
>  	.release = sca3000_ring_release,
>  };
> diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
> index b0e006c..79cdb3d 100644
> --- a/include/linux/iio/buffer.h
> +++ b/include/linux/iio/buffer.h
> @@ -25,7 +25,6 @@ struct iio_buffer;
>   *			available.
>   * @request_update:	if a parameter change has been marked, update underlying
>   *			storage.
> - * @get_bytes_per_datum:get current bytes per datum
>   * @set_bytes_per_datum:set number of bytes per datum
>   * @get_length:		get number of datums in buffer
>   * @set_length:		set number of datums in buffer
> @@ -49,7 +48,6 @@ struct iio_buffer_access_funcs {
>  
>  	int (*request_update)(struct iio_buffer *buffer);
>  
> -	int (*get_bytes_per_datum)(struct iio_buffer *buffer);
>  	int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd);
>  	int (*get_length)(struct iio_buffer *buffer);
>  	int (*set_length)(struct iio_buffer *buffer, int length);
> 


  reply	other threads:[~2014-12-12 10:51 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 17:55 [PATCH 00/11] iio: Buffer cleanups and consolidations Lars-Peter Clausen
2014-11-26 17:55 ` [PATCH 01/11] staging:iio:ad5933: Don't enable channels by default Lars-Peter Clausen
2014-12-04 22:51   ` Daniel Baluta
2014-12-12 10:21     ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 02/11] staging:iio:sca3000: " Lars-Peter Clausen
2014-12-04 22:51   ` Daniel Baluta
2014-12-12 10:22     ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 03/11] iio: Unexport iio_scan_mask_set() Lars-Peter Clausen
2014-12-05  9:53   ` Daniel Baluta
2014-12-12 10:23     ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 04/11] staging:iio:sca3000: Register same channels for device and buffer Lars-Peter Clausen
2014-12-04 22:56   ` Daniel Baluta
2014-12-12 10:28     ` Jonathan Cameron
2014-12-10 22:35   ` Hartmut Knaack
2014-12-12 10:29     ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 05/11] staging:iio:dummy: " Lars-Peter Clausen
2014-12-04 14:27   ` Daniel Baluta
2014-12-12 10:30     ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 06/11] iio: Move buffer registration to the core Lars-Peter Clausen
2014-12-04 14:23   ` Daniel Baluta
2014-12-12 10:49     ` Jonathan Cameron
2014-12-12 10:48   ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 07/11] iio: Remove get_bytes_per_datum() from iio_buffer_access_funcs Lars-Peter Clausen
2014-12-12 10:51   ` Jonathan Cameron [this message]
2014-11-26 17:55 ` [PATCH 08/11] iio: buffer: Move iio_buffer_alloc_sysfs and iio_buffer_free_sysfs Lars-Peter Clausen
2014-12-12 10:57   ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 09/11] iio: buffer: Allocate standard attributes in the core Lars-Peter Clausen
2014-12-10 22:42   ` Hartmut Knaack
2014-12-12 11:06     ` Jonathan Cameron
2014-11-26 17:55 ` [PATCH 10/11] iio: buffer: Make length attribute read only for buffers without set_length Lars-Peter Clausen
2014-12-12 11:08   ` Jonathan Cameron
2014-12-12 11:11     ` Jonathan Cameron
2014-12-18 16:35       ` Lars-Peter Clausen
2014-11-26 17:55 ` [PATCH 11/11] iio: buffer: Drop get_length callback Lars-Peter Clausen
2014-12-12 11:13   ` 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=548AC8AF.4080908@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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).