[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <550F7144.9050608@samsung.com>
Date: Mon, 23 Mar 2015 10:49:56 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: MyungJoo Ham <myungjoo.ham@...sung.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch 2/2] extcon: max77843: fix an error code in
max77843_init_muic_regmap()
Hi Dan,
On 03/15/2015 07:56 PM, Dan Carpenter wrote:
> "max77843->i2c_muic" is NULL, not an error code. Let's return -ENODEV
> here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
> index a3f80ca..6f0ed5a 100644
> --- a/drivers/extcon/extcon-max77843.c
> +++ b/drivers/extcon/extcon-max77843.c
> @@ -715,7 +715,7 @@ static int max77843_init_muic_regmap(struct max77843 *max77843)
> if (!max77843->i2c_muic) {
> dev_err(&max77843->i2c->dev,
> "Cannot allocate I2C device for MUIC\n");
> - return PTR_ERR(max77843->i2c_muic);
> + return -ENODEV;
I think that -ENOMEM is more proper error than -ENODEV.
So, I'll use -ENOMEM value and applied it on extcon-next branch.
Thanks,
Chanwoo Choi
> }
>
> i2c_set_clientdata(max77843->i2c_muic, max77843);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists