Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <linux-iio@vger.kernel.org>, <linux-spi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <broonie@kernel.org>
Subject: Re: [PATCH v2 4/4] iio: imu: adis: convert cs_change_delay to spi_delay struct
Date: Sun, 15 Sep 2019 11:14:42 +0100
Message-ID: <20190915111442.27e3c221@archlinux> (raw)
In-Reply-To: <20190913115549.3823-5-alexandru.ardelean@analog.com>

On Fri, 13 Sep 2019 14:55:49 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> The ADIS library is one of the few users of the new `cs_change_delay`
> parameter for an spi_transfer.
> 
> The introduction of the `spi_delay` struct, requires that the users of of
> `cs_change_delay` get an update. This change updates the ADIS library.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

Looks to me like the build is broken between patches 3 and 4.
Don't do that as it breaks bisectability.

If you are changing an interface like this it has to occur in one patch,
of you have to have intermediate code that deals with the smooth transition.

Otherwise, looks like a sensible bit of rework to me.

Jonathan

> ---
>  drivers/iio/imu/adis.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c
> index 1631c255deab..2cd2cc2316c6 100644
> --- a/drivers/iio/imu/adis.c
> +++ b/drivers/iio/imu/adis.c
> @@ -39,24 +39,24 @@ int adis_write_reg(struct adis *adis, unsigned int reg,
>  			.len = 2,
>  			.cs_change = 1,
>  			.delay_usecs = adis->data->write_delay,
> -			.cs_change_delay = adis->data->cs_change_delay,
> -			.cs_change_delay_unit = SPI_DELAY_UNIT_USECS,
> +			.cs_change_delay.value = adis->data->cs_change_delay,
> +			.cs_change_delay.unit = SPI_DELAY_UNIT_USECS,
>  		}, {
>  			.tx_buf = adis->tx + 2,
>  			.bits_per_word = 8,
>  			.len = 2,
>  			.cs_change = 1,
>  			.delay_usecs = adis->data->write_delay,
> -			.cs_change_delay = adis->data->cs_change_delay,
> -			.cs_change_delay_unit = SPI_DELAY_UNIT_USECS,
> +			.cs_change_delay.value = adis->data->cs_change_delay,
> +			.cs_change_delay.unit = SPI_DELAY_UNIT_USECS,
>  		}, {
>  			.tx_buf = adis->tx + 4,
>  			.bits_per_word = 8,
>  			.len = 2,
>  			.cs_change = 1,
>  			.delay_usecs = adis->data->write_delay,
> -			.cs_change_delay = adis->data->cs_change_delay,
> -			.cs_change_delay_unit = SPI_DELAY_UNIT_USECS,
> +			.cs_change_delay.value = adis->data->cs_change_delay,
> +			.cs_change_delay.unit = SPI_DELAY_UNIT_USECS,
>  		}, {
>  			.tx_buf = adis->tx + 6,
>  			.bits_per_word = 8,
> @@ -139,16 +139,16 @@ int adis_read_reg(struct adis *adis, unsigned int reg,
>  			.len = 2,
>  			.cs_change = 1,
>  			.delay_usecs = adis->data->write_delay,
> -			.cs_change_delay = adis->data->cs_change_delay,
> -			.cs_change_delay_unit = SPI_DELAY_UNIT_USECS,
> +			.cs_change_delay.value = adis->data->cs_change_delay,
> +			.cs_change_delay.unit = SPI_DELAY_UNIT_USECS,
>  		}, {
>  			.tx_buf = adis->tx + 2,
>  			.bits_per_word = 8,
>  			.len = 2,
>  			.cs_change = 1,
>  			.delay_usecs = adis->data->read_delay,
> -			.cs_change_delay = adis->data->cs_change_delay,
> -			.cs_change_delay_unit = SPI_DELAY_UNIT_USECS,
> +			.cs_change_delay.value = adis->data->cs_change_delay,
> +			.cs_change_delay.unit = SPI_DELAY_UNIT_USECS,
>  		}, {
>  			.tx_buf = adis->tx + 4,
>  			.rx_buf = adis->rx,
> @@ -156,8 +156,8 @@ int adis_read_reg(struct adis *adis, unsigned int reg,
>  			.len = 2,
>  			.cs_change = 1,
>  			.delay_usecs = adis->data->read_delay,
> -			.cs_change_delay = adis->data->cs_change_delay,
> -			.cs_change_delay_unit = SPI_DELAY_UNIT_USECS,
> +			.cs_change_delay.value = adis->data->cs_change_delay,
> +			.cs_change_delay.unit = SPI_DELAY_UNIT_USECS,
>  		}, {
>  			.rx_buf = adis->rx + 2,
>  			.bits_per_word = 8,


  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 11:55 [PATCH v2 0/4] spi: introduce `struct spi_delay` data-type Alexandru Ardelean
2019-09-13 11:55 ` [PATCH v2 1/4] spi: move `cs_change_delay` backwards compat logic outside switch Alexandru Ardelean
2019-09-13 11:55 ` [PATCH v2 2/4] spi: introduce spi_delay struct as "value + unit" & spi_delay_exec() Alexandru Ardelean
2019-09-13 11:55 ` [PATCH v2 3/4] spi: make `cs_change_delay` the first user of the `spi_delay` logic Alexandru Ardelean
2019-09-13 11:55 ` [PATCH v2 4/4] iio: imu: adis: convert cs_change_delay to spi_delay struct Alexandru Ardelean
2019-09-15 10:14   ` Jonathan Cameron [this message]
2019-09-16  6:58     ` Ardelean, Alexandru

Reply instructions:

You may reply publically 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=20190915111442.27e3c221@archlinux \
    --to=jic23@kernel.org \
    --cc=alexandru.ardelean@analog.com \
    --cc=broonie@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@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

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox