linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: linux-i2c@vger.kernel.org
Cc: Lixin Wang <alan.1.wang@nokia-sbell.com>,
	Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 3/5] i2c: of: rename variable to meet expectations
Date: Thu, 18 Jan 2018 13:11:31 +0100	[thread overview]
Message-ID: <20180118121133.13554-4-wsa@the-dreams.de> (raw)
In-Reply-To: <20180118121133.13554-1-wsa@the-dreams.de>

'result' is mostly used in the kernel as int for functions returning
errno on failure. Here it is a pointer to the client struct, so let's
call it this way (as the parent function does, too).

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/i2c/i2c-core-of.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 5e2d55b3daacca..4b573ee4a8203a 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -25,7 +25,7 @@
 static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
 						 struct device_node *node)
 {
-	struct i2c_client *result;
+	struct i2c_client *client;
 	struct i2c_board_info info = {};
 	struct dev_archdata dev_ad = {};
 	const __be32 *addr_be;
@@ -73,13 +73,13 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
 	if (of_get_property(node, "wakeup-source", NULL))
 		info.flags |= I2C_CLIENT_WAKE;
 
-	result = i2c_new_device(adap, &info);
-	if (result == NULL) {
+	client = i2c_new_device(adap, &info);
+	if (!client) {
 		dev_err(&adap->dev, "of_i2c: Failure registering %pOF\n", node);
 		of_node_put(node);
 		return ERR_PTR(-EINVAL);
 	}
-	return result;
+	return client;
 }
 
 void of_i2c_register_devices(struct i2c_adapter *adap)
-- 
2.11.0

  parent reply	other threads:[~2018-01-18 12:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 12:11 [PATCH 0/5] i2c: of: brush up the code a little Wolfram Sang
2018-01-18 12:11 ` [PATCH 1/5] i2c: of: change log level of failed device creation Wolfram Sang
2018-01-18 12:11 ` [PATCH 2/5] i2c: of: make ref counting more visible Wolfram Sang
2018-01-18 12:11 ` Wolfram Sang [this message]
2018-01-18 12:11 ` [PATCH 4/5] i2c: of: remove duplicated check for valid address Wolfram Sang
2018-01-18 12:11 ` [PATCH 5/5] i2c: of: simplify reading the "reg" property Wolfram Sang

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=20180118121133.13554-4-wsa@the-dreams.de \
    --to=wsa@the-dreams.de \
    --cc=alan.1.wang@nokia-sbell.com \
    --cc=linux-i2c@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 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).