linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device()
@ 2019-07-22 17:26 Wolfram Sang
  2019-07-22 17:26 ` [PATCH 1/4] rtc: isl12026: convert to i2c_new_dummy_device Wolfram Sang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, linux-kernel, linux-rtc, linux-samsung-soc

This series is part of a tree-wide movement to replace the I2C API call
'i2c_new_dummy' which returns NULL with its new counterpart returning an
ERRPTR.

The series was generated with coccinelle (audited afterwards, of course) and
build tested by me and by buildbot. No tests on HW have been performed.

The branch is based on v5.3-rc1. A branch (with some more stuff included) can
be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/new_dummy

Some drivers still need to be manually converted. Patches for those will be
sent out individually.


Wolfram Sang (4):
  rtc: isl12026: convert to i2c_new_dummy_device
  rtc: max77686: convert to i2c_new_dummy_device
  rtc: s35390a: convert to i2c_new_dummy_device
  rtc: s5m: convert to i2c_new_dummy_device

 drivers/rtc/rtc-isl12026.c | 6 +++---
 drivers/rtc/rtc-max77686.c | 6 +++---
 drivers/rtc/rtc-s35390a.c  | 6 +++---
 drivers/rtc/rtc-s5m.c      | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] rtc: isl12026: convert to i2c_new_dummy_device
  2019-07-22 17:26 [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Wolfram Sang
@ 2019-07-22 17:26 ` Wolfram Sang
  2019-07-22 17:26 ` [PATCH 2/4] rtc: max77686: " Wolfram Sang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Alessandro Zummo, Alexandre Belloni, linux-rtc,
	linux-kernel

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/rtc/rtc-isl12026.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-isl12026.c b/drivers/rtc/rtc-isl12026.c
index 97f594f9667c..5b6b17fb6d62 100644
--- a/drivers/rtc/rtc-isl12026.c
+++ b/drivers/rtc/rtc-isl12026.c
@@ -454,9 +454,9 @@ static int isl12026_probe_new(struct i2c_client *client)
 
 	isl12026_force_power_modes(client);
 
-	priv->nvm_client = i2c_new_dummy(client->adapter, ISL12026_EEPROM_ADDR);
-	if (!priv->nvm_client)
-		return -ENOMEM;
+	priv->nvm_client = i2c_new_dummy_device(client->adapter, ISL12026_EEPROM_ADDR);
+	if (IS_ERR(priv->nvm_client))
+		return PTR_ERR(priv->nvm_client);
 
 	priv->rtc = devm_rtc_allocate_device(&client->dev);
 	ret = PTR_ERR_OR_ZERO(priv->rtc);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] rtc: max77686: convert to i2c_new_dummy_device
  2019-07-22 17:26 [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Wolfram Sang
  2019-07-22 17:26 ` [PATCH 1/4] rtc: isl12026: convert to i2c_new_dummy_device Wolfram Sang
@ 2019-07-22 17:26 ` Wolfram Sang
  2019-07-23 15:27   ` Krzysztof Kozlowski
  2019-07-22 17:26 ` [PATCH 3/4] rtc: s35390a: " Wolfram Sang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Chanwoo Choi, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, Alessandro Zummo, Alexandre Belloni,
	linux-kernel, linux-rtc

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/rtc/rtc-max77686.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index 4aff349ae301..d04fd1024697 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -693,11 +693,11 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info)
 		goto add_rtc_irq;
 	}
 
-	info->rtc = i2c_new_dummy(parent_i2c->adapter,
+	info->rtc = i2c_new_dummy_device(parent_i2c->adapter,
 				  info->drv_data->rtc_i2c_addr);
-	if (!info->rtc) {
+	if (IS_ERR(info->rtc)) {
 		dev_err(info->dev, "Failed to allocate I2C device for RTC\n");
-		return -ENODEV;
+		return PTR_ERR(info->rtc);
 	}
 
 	info->rtc_regmap = devm_regmap_init_i2c(info->rtc,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] rtc: s35390a: convert to i2c_new_dummy_device
  2019-07-22 17:26 [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Wolfram Sang
  2019-07-22 17:26 ` [PATCH 1/4] rtc: isl12026: convert to i2c_new_dummy_device Wolfram Sang
  2019-07-22 17:26 ` [PATCH 2/4] rtc: max77686: " Wolfram Sang
@ 2019-07-22 17:26 ` Wolfram Sang
  2019-07-22 17:26 ` [PATCH 4/4] rtc: s5m: " Wolfram Sang
  2019-07-22 20:50 ` [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Alexandre Belloni
  4 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Alessandro Zummo, Alexandre Belloni, linux-rtc,
	linux-kernel

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/rtc/rtc-s35390a.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c
index 84806ff763cf..5826209a3f30 100644
--- a/drivers/rtc/rtc-s35390a.c
+++ b/drivers/rtc/rtc-s35390a.c
@@ -450,12 +450,12 @@ static int s35390a_probe(struct i2c_client *client,
 
 	/* This chip uses multiple addresses, use dummy devices for them */
 	for (i = 1; i < 8; ++i) {
-		s35390a->client[i] = i2c_new_dummy(client->adapter,
+		s35390a->client[i] = i2c_new_dummy_device(client->adapter,
 					client->addr + i);
-		if (!s35390a->client[i]) {
+		if (IS_ERR(s35390a->client[i])) {
 			dev_err(dev, "Address %02x unavailable\n",
 				client->addr + i);
-			err = -EBUSY;
+			err = PTR_ERR(s35390a->client[i]);
 			goto exit_dummy;
 		}
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] rtc: s5m: convert to i2c_new_dummy_device
  2019-07-22 17:26 [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Wolfram Sang
                   ` (2 preceding siblings ...)
  2019-07-22 17:26 ` [PATCH 3/4] rtc: s35390a: " Wolfram Sang
@ 2019-07-22 17:26 ` Wolfram Sang
  2019-07-23 15:32   ` Krzysztof Kozlowski
  2019-07-22 20:50 ` [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Alexandre Belloni
  4 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Sangbeom Kim, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, Alessandro Zummo, Alexandre Belloni,
	linux-kernel, linux-samsung-soc, linux-rtc

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/rtc/rtc-s5m.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index c7f1bf823ea0..eb9dde4095a9 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -760,10 +760,10 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	info->i2c = i2c_new_dummy(s5m87xx->i2c->adapter, RTC_I2C_ADDR);
-	if (!info->i2c) {
+	info->i2c = i2c_new_dummy_device(s5m87xx->i2c->adapter, RTC_I2C_ADDR);
+	if (IS_ERR(info->i2c)) {
 		dev_err(&pdev->dev, "Failed to allocate I2C for RTC\n");
-		return -ENODEV;
+		return PTR_ERR(info->i2c);
 	}
 
 	info->regmap = devm_regmap_init_i2c(info->i2c, regmap_cfg);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device()
  2019-07-22 17:26 [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Wolfram Sang
                   ` (3 preceding siblings ...)
  2019-07-22 17:26 ` [PATCH 4/4] rtc: s5m: " Wolfram Sang
@ 2019-07-22 20:50 ` Alexandre Belloni
  4 siblings, 0 replies; 8+ messages in thread
From: Alexandre Belloni @ 2019-07-22 20:50 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, linux-rtc, linux-samsung-soc

On 22/07/2019 19:26:14+0200, Wolfram Sang wrote:
> This series is part of a tree-wide movement to replace the I2C API call
> 'i2c_new_dummy' which returns NULL with its new counterpart returning an
> ERRPTR.
> 
> The series was generated with coccinelle (audited afterwards, of course) and
> build tested by me and by buildbot. No tests on HW have been performed.
> 
> The branch is based on v5.3-rc1. A branch (with some more stuff included) can
> be found here:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/new_dummy
> 
> Some drivers still need to be manually converted. Patches for those will be
> sent out individually.
> 
> 
> Wolfram Sang (4):
>   rtc: isl12026: convert to i2c_new_dummy_device
>   rtc: max77686: convert to i2c_new_dummy_device
>   rtc: s35390a: convert to i2c_new_dummy_device
>   rtc: s5m: convert to i2c_new_dummy_device
> 
>  drivers/rtc/rtc-isl12026.c | 6 +++---
>  drivers/rtc/rtc-max77686.c | 6 +++---
>  drivers/rtc/rtc-s35390a.c  | 6 +++---
>  drivers/rtc/rtc-s5m.c      | 6 +++---
>  4 files changed, 12 insertions(+), 12 deletions(-)
> 
All applied, thanks!

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] rtc: max77686: convert to i2c_new_dummy_device
  2019-07-22 17:26 ` [PATCH 2/4] rtc: max77686: " Wolfram Sang
@ 2019-07-23 15:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2019-07-23 15:27 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Chanwoo Choi, Bartlomiej Zolnierkiewicz,
	Alessandro Zummo, Alexandre Belloni, linux-kernel, linux-rtc

On Mon, 22 Jul 2019 at 19:26, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> 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/rtc/rtc-max77686.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] rtc: s5m: convert to i2c_new_dummy_device
  2019-07-22 17:26 ` [PATCH 4/4] rtc: s5m: " Wolfram Sang
@ 2019-07-23 15:32   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2019-07-23 15:32 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Sangbeom Kim, Bartlomiej Zolnierkiewicz,
	Alessandro Zummo, Alexandre Belloni, linux-kernel,
	linux-samsung-soc, linux-rtc

On Mon, 22 Jul 2019 at 19:26, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> 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/rtc/rtc-s5m.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-07-23 15:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 17:26 [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Wolfram Sang
2019-07-22 17:26 ` [PATCH 1/4] rtc: isl12026: convert to i2c_new_dummy_device Wolfram Sang
2019-07-22 17:26 ` [PATCH 2/4] rtc: max77686: " Wolfram Sang
2019-07-23 15:27   ` Krzysztof Kozlowski
2019-07-22 17:26 ` [PATCH 3/4] rtc: s35390a: " Wolfram Sang
2019-07-22 17:26 ` [PATCH 4/4] rtc: s5m: " Wolfram Sang
2019-07-23 15:32   ` Krzysztof Kozlowski
2019-07-22 20:50 ` [PATCH 0/4] rtc: convert subsystem to i2c_new_dummy_device() Alexandre Belloni

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).