Skip to content

Commit

Permalink
extcon: extcon-max77843: convert to i2c_new_dummy_device
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
  • Loading branch information
Wolfram Sang authored and chanwoochoi committed Jul 24, 2019
1 parent a104dbc commit a6d9cfc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/extcon/extcon-max77843.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a6d9cfc

Please sign in to comment.