[1/1] extcon: extcon-max77843: convert to i2c_new_dummy_device
diff mbox series

Message ID 20190722172601.3506-2-wsa+renesas@sang-engineering.com
State Awaiting Upstream
Headers show
Series
  • extcon: convert subsystem to i2c_new_dummy_device()
Related show

Commit Message

Wolfram Sang July 22, 2019, 5:26 p.m. UTC
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(-)

Comments

Chanwoo Choi July 24, 2019, 10:04 a.m. UTC | #1
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.

Patch
diff mbox series

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