linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] extcon: convert subsystem to i2c_new_dummy_device()
@ 2019-07-22 17:26 Wolfram Sang
  2019-07-22 17:26 ` [PATCH 1/1] extcon: extcon-max77843: convert to i2c_new_dummy_device Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, linux-kernel

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 (1):
  extcon: extcon-max77843: convert to i2c_new_dummy_device

 drivers/extcon/extcon-max77843.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.20.1


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

* [PATCH 1/1] extcon: extcon-max77843: convert to i2c_new_dummy_device
  2019-07-22 17:26 [PATCH 0/1] extcon: convert subsystem to i2c_new_dummy_device() Wolfram Sang
@ 2019-07-22 17:26 ` Wolfram Sang
  2019-07-24 10:04   ` Chanwoo Choi
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, MyungJoo Ham, Chanwoo Choi, 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/extcon/extcon-max77843.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index a343a6ef3506..e6b50ca83008 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -774,12 +774,12 @@ static int max77843_init_muic_regmap(struct max77693_dev *max77843)
 {
 	int ret;
 
-	max77843->i2c_muic = i2c_new_dummy(max77843->i2c->adapter,
+	max77843->i2c_muic = i2c_new_dummy_device(max77843->i2c->adapter,
 			I2C_ADDR_MUIC);
-	if (!max77843->i2c_muic) {
+	if (IS_ERR(max77843->i2c_muic)) {
 		dev_err(&max77843->i2c->dev,
 				"Cannot allocate I2C device for MUIC\n");
-		return -ENOMEM;
+		return PTR_ERR(max77843->i2c_muic);
 	}
 
 	i2c_set_clientdata(max77843->i2c_muic, max77843);
-- 
2.20.1


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

* Re: [PATCH 1/1] extcon: extcon-max77843: convert to i2c_new_dummy_device
  2019-07-22 17:26 ` [PATCH 1/1] extcon: extcon-max77843: convert to i2c_new_dummy_device Wolfram Sang
@ 2019-07-24 10:04   ` Chanwoo Choi
  0 siblings, 0 replies; 3+ messages in thread
From: Chanwoo Choi @ 2019-07-24 10:04 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c; +Cc: MyungJoo Ham, linux-kernel

On 19. 7. 23. 오전 2:26, Wolfram Sang 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/extcon/extcon-max77843.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
> index a343a6ef3506..e6b50ca83008 100644
> --- a/drivers/extcon/extcon-max77843.c
> +++ b/drivers/extcon/extcon-max77843.c
> @@ -774,12 +774,12 @@ static int max77843_init_muic_regmap(struct max77693_dev *max77843)
>  {
>  	int ret;
>  
> -	max77843->i2c_muic = i2c_new_dummy(max77843->i2c->adapter,
> +	max77843->i2c_muic = i2c_new_dummy_device(max77843->i2c->adapter,
>  			I2C_ADDR_MUIC);
> -	if (!max77843->i2c_muic) {
> +	if (IS_ERR(max77843->i2c_muic)) {
>  		dev_err(&max77843->i2c->dev,
>  				"Cannot allocate I2C device for MUIC\n");
> -		return -ENOMEM;
> +		return PTR_ERR(max77843->i2c_muic);
>  	}
>  
>  	i2c_set_clientdata(max77843->i2c_muic, max77843);
> 

Applied it. Thanks.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

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

end of thread, other threads:[~2019-07-24 10:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 17:26 [PATCH 0/1] extcon: convert subsystem to i2c_new_dummy_device() Wolfram Sang
2019-07-22 17:26 ` [PATCH 1/1] extcon: extcon-max77843: convert to i2c_new_dummy_device Wolfram Sang
2019-07-24 10:04   ` Chanwoo Choi

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