All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: linux-kernel@vger.kernel.org
Cc: Peter Rosin <peda@axentia.se>,
	Brendan Higgins <brendanhiggins@google.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
	linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	linux-aspeed@lists.ozlabs.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [PATCH 04/21] i2c: aspeed: make use of i2c_8bit_addr_from_msg
Date: Mon, 14 May 2018 16:53:13 +0200	[thread overview]
Message-ID: <20180514145330.4857-5-peda@axentia.se> (raw)
In-Reply-To: <20180514145330.4857-1-peda@axentia.se>

Because it looks neater.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/busses/i2c-aspeed.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 7d4aeb4465b3..60e4d0e939a3 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -335,13 +335,12 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
 {
 	u32 command = ASPEED_I2CD_M_START_CMD | ASPEED_I2CD_M_TX_CMD;
 	struct i2c_msg *msg = &bus->msgs[bus->msgs_index];
-	u8 slave_addr = msg->addr << 1;
+	u8 slave_addr = i2c_8bit_addr_from_msg(msg);
 
 	bus->master_state = ASPEED_I2C_MASTER_START;
 	bus->buf_index = 0;
 
 	if (msg->flags & I2C_M_RD) {
-		slave_addr |= 1;
 		command |= ASPEED_I2CD_M_RX_CMD;
 		/* Need to let the hardware know to NACK after RX. */
 		if (msg->len == 1 && !(msg->flags & I2C_M_RECV_LEN))
-- 
2.11.0

WARNING: multiple messages have this Message-ID (diff)
From: Peter Rosin <peda@axentia.se>
To: linux-kernel@vger.kernel.org
Cc: linux-aspeed@lists.ozlabs.org, Andrew Jeffery <andrew@aj.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	openbmc@lists.ozlabs.org,
	Brendan Higgins <brendanhiggins@google.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-i2c@vger.kernel.org, Peter Rosin <peda@axentia.se>,
	linux-arm-kernel@lists.infradead.org,
	Joel Stanley <joel@jms.id.au>
Subject: [PATCH 04/21] i2c: aspeed: make use of i2c_8bit_addr_from_msg
Date: Mon, 14 May 2018 16:53:13 +0200	[thread overview]
Message-ID: <20180514145330.4857-5-peda@axentia.se> (raw)
In-Reply-To: <20180514145330.4857-1-peda@axentia.se>

Because it looks neater.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/busses/i2c-aspeed.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 7d4aeb4465b3..60e4d0e939a3 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -335,13 +335,12 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
 {
 	u32 command = ASPEED_I2CD_M_START_CMD | ASPEED_I2CD_M_TX_CMD;
 	struct i2c_msg *msg = &bus->msgs[bus->msgs_index];
-	u8 slave_addr = msg->addr << 1;
+	u8 slave_addr = i2c_8bit_addr_from_msg(msg);
 
 	bus->master_state = ASPEED_I2C_MASTER_START;
 	bus->buf_index = 0;
 
 	if (msg->flags & I2C_M_RD) {
-		slave_addr |= 1;
 		command |= ASPEED_I2CD_M_RX_CMD;
 		/* Need to let the hardware know to NACK after RX. */
 		if (msg->len == 1 && !(msg->flags & I2C_M_RECV_LEN))
-- 
2.11.0

WARNING: multiple messages have this Message-ID (diff)
From: peda@axentia.se (Peter Rosin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/21] i2c: aspeed: make use of i2c_8bit_addr_from_msg
Date: Mon, 14 May 2018 16:53:13 +0200	[thread overview]
Message-ID: <20180514145330.4857-5-peda@axentia.se> (raw)
In-Reply-To: <20180514145330.4857-1-peda@axentia.se>

Because it looks neater.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/busses/i2c-aspeed.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 7d4aeb4465b3..60e4d0e939a3 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -335,13 +335,12 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
 {
 	u32 command = ASPEED_I2CD_M_START_CMD | ASPEED_I2CD_M_TX_CMD;
 	struct i2c_msg *msg = &bus->msgs[bus->msgs_index];
-	u8 slave_addr = msg->addr << 1;
+	u8 slave_addr = i2c_8bit_addr_from_msg(msg);
 
 	bus->master_state = ASPEED_I2C_MASTER_START;
 	bus->buf_index = 0;
 
 	if (msg->flags & I2C_M_RD) {
-		slave_addr |= 1;
 		command |= ASPEED_I2CD_M_RX_CMD;
 		/* Need to let the hardware know to NACK after RX. */
 		if (msg->len == 1 && !(msg->flags & I2C_M_RECV_LEN))
-- 
2.11.0

  parent reply	other threads:[~2018-05-14 14:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 14:53 [PATCH 00/21] i2c: make use of i2c_8bit_addr_from_msg Peter Rosin
2018-05-14 14:53 ` Peter Rosin
2018-05-14 14:53 ` [PATCH 01/21] i2c: algo: bit: " Peter Rosin
2018-05-14 14:53 ` [PATCH 02/21] i2c: algo: pca: " Peter Rosin
2018-05-14 14:53 ` [PATCH 03/21] i2c: algo: pcf: " Peter Rosin
2018-05-14 16:59   ` Andy Shevchenko
2018-05-14 17:03     ` Peter Rosin
2018-05-14 14:53 ` Peter Rosin [this message]
2018-05-14 14:53   ` [PATCH 04/21] i2c: aspeed: " Peter Rosin
2018-05-14 14:53   ` Peter Rosin
2018-05-14 14:53 ` [PATCH 05/21] i2c: axxia: " Peter Rosin
2018-05-14 14:53 ` [PATCH 06/21] i2c: diolan: " Peter Rosin
2018-05-14 15:50   ` Guenter Roeck
2018-05-14 14:53 ` [PATCH 07/21] i2c: efm32: " Peter Rosin
2018-05-14 14:53   ` Peter Rosin
2018-05-14 18:27   ` Uwe Kleine-König
2018-05-14 18:27     ` Uwe Kleine-König
2018-05-14 14:53 ` [PATCH 08/21] i2c: eg20t: " Peter Rosin
2018-05-14 14:53 ` [PATCH 09/21] i2c: emev2: " Peter Rosin
2018-05-14 14:53 ` [PATCH 10/21] i2c: hix5hd2: " Peter Rosin
2018-05-14 14:53 ` [PATCH 11/21] i2c: imx-lpi2c: " Peter Rosin
2018-05-14 14:53 ` [PATCH 12/21] i2c: imx: " Peter Rosin
2018-05-14 18:32   ` Uwe Kleine-König
2018-05-14 14:53 ` [PATCH 13/21] i2c: kempld: " Peter Rosin
2018-05-14 14:53 ` [PATCH 14/21] i2c: mxs: " Peter Rosin
2018-05-14 14:53 ` [PATCH 15/21] i2c: ocores: " Peter Rosin
2018-05-14 14:53 ` [PATCH 16/21] i2c: pasemi: " Peter Rosin
2018-05-14 14:53 ` [PATCH 17/21] i2c: qup: " Peter Rosin
2018-05-14 14:53 ` [PATCH 18/21] i2c: rcar: " Peter Rosin
2018-05-14 14:53 ` [PATCH 19/21] i2c: riic: " Peter Rosin
2018-05-14 14:53 ` [PATCH 20/21] i2c: stu300: " Peter Rosin
2018-05-14 14:53   ` Peter Rosin
2018-05-14 19:54   ` Linus Walleij
2018-05-14 19:54     ` Linus Walleij
2018-05-14 14:53 ` [PATCH 21/21] i2c: xiic: " Peter Rosin
2018-05-14 16:11 ` [PATCH 00/21] i2c: " Joe Perches
2018-05-14 16:11   ` Joe Perches
2018-05-14 17:01   ` Peter Rosin
2018-05-14 17:01     ` Peter Rosin

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=20180514145330.4857-5-peda@axentia.se \
    --to=peda@axentia.se \
    --cc=andrew@aj.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=brendanhiggins@google.com \
    --cc=joel@jms.id.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=wsa+renesas@sang-engineering.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 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.