linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 07/14] mfd: max77693: convert to i2c_new_dummy_device
Date: Mon, 22 Jul 2019 19:26:14 +0200	[thread overview]
Message-ID: <20190722172623.4166-8-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20190722172623.4166-1-wsa+renesas@sang-engineering.com>

Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Generated with coccinelle. Build tested by me and buildbot. Not tested on HW.

 drivers/mfd/max77693.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index 901d99d65924..596ed85cab3b 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -183,17 +183,17 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
 	} else
 		dev_info(max77693->dev, "device ID: 0x%x\n", reg_data);
 
-	max77693->i2c_muic = i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC);
-	if (!max77693->i2c_muic) {
+	max77693->i2c_muic = i2c_new_dummy_device(i2c->adapter, I2C_ADDR_MUIC);
+	if (IS_ERR(max77693->i2c_muic)) {
 		dev_err(max77693->dev, "Failed to allocate I2C device for MUIC\n");
-		return -ENODEV;
+		return PTR_ERR(max77693->i2c_muic);
 	}
 	i2c_set_clientdata(max77693->i2c_muic, max77693);
 
-	max77693->i2c_haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC);
-	if (!max77693->i2c_haptic) {
+	max77693->i2c_haptic = i2c_new_dummy_device(i2c->adapter, I2C_ADDR_HAPTIC);
+	if (IS_ERR(max77693->i2c_haptic)) {
 		dev_err(max77693->dev, "Failed to allocate I2C device for Haptic\n");
-		ret = -ENODEV;
+		ret = PTR_ERR(max77693->i2c_haptic);
 		goto err_i2c_haptic;
 	}
 	i2c_set_clientdata(max77693->i2c_haptic, max77693);
-- 
2.20.1

  parent reply	other threads:[~2019-07-22 17:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 17:26 [PATCH 00/14] mfd: convert subsystem to i2c_new_dummy_device() Wolfram Sang
2019-07-22 17:26 ` [PATCH 01/14] mfd: 88pm800: convert to i2c_new_dummy_device Wolfram Sang
2019-08-12  7:46   ` Lee Jones
2019-07-22 17:26 ` [PATCH 02/14] mfd: 88pm860x-core: " Wolfram Sang
2019-08-12  7:46   ` Lee Jones
2019-07-22 17:26 ` [PATCH 03/14] mfd: ab3100-core: " Wolfram Sang
2019-07-23  8:30   ` Linus Walleij
2019-08-12  7:46   ` Lee Jones
2019-07-22 17:26 ` [PATCH 04/14] mfd: bcm590xx: " Wolfram Sang
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` [PATCH 05/14] mfd: da9150-core: " Wolfram Sang
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` [PATCH 06/14] mfd: max14577: " Wolfram Sang
2019-07-23 17:35   ` Krzysztof Kozlowski
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` Wolfram Sang [this message]
2019-07-23 17:35   ` [PATCH 07/14] mfd: max77693: " Krzysztof Kozlowski
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` [PATCH 08/14] mfd: max77843: " Wolfram Sang
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` [PATCH 09/14] mfd: max8907: " Wolfram Sang
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` [PATCH 10/14] mfd: max8925-i2c: " Wolfram Sang
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` [PATCH 11/14] mfd: max8997: " Wolfram Sang
2019-08-12  7:47   ` Lee Jones
2019-07-22 17:26 ` [PATCH 12/14] mfd: max8998: " Wolfram Sang
2019-08-12  7:48   ` Lee Jones
2019-07-22 17:26 ` [PATCH 13/14] mfd: palmas: " Wolfram Sang
2019-08-12  7:48   ` Lee Jones
2019-07-22 17:26 ` [PATCH 14/14] mfd: twl-core: " Wolfram Sang
2019-08-12  7:48   ` Lee Jones

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=20190722172623.4166-8-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=krzk@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@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).