Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3543859pxj; Mon, 7 Jun 2021 13:33:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqfke81SK0Hayi+4TUX1rQva6K4aSbrDL3jrZuAKTR2Ug7oCXm+KS7QXNY/UUuWTteOigj X-Received: by 2002:a05:6402:2049:: with SMTP id bc9mr21946408edb.298.1623098028866; Mon, 07 Jun 2021 13:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623098028; cv=none; d=google.com; s=arc-20160816; b=l9k88r/k0bYxVHVkhrMAXugkYkhwNHZAHXMY1RJ6T0F1v7AGztcQznxyF4IbrLmpL3 Rqcm8uyAqSOOAYe9Ku6pL/SbM4CeKgISZXN3uoxyFFSi66rf82BWbl6wFK5Nvlzm8/b4 +hozyfp9NHcS+j0BdWN92P6qKNL2fcm7urCGiRMBqjLGoJioMGAPUP5JdtkRFHGvYsTz 02uKb6lQT9g7D3obJbkq+gTA2TxhT4NDdC5P5WDb8+hYTx9Aeu+GbYWOtZmDf7iHf19n V7hU2ak0D4qGMnAFPWktCpplPVxUFVhBg4ZeU7w9BZJWdehRthb3+7Tm4CEEHmElerI4 uZNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=DfWJk574sLSSpMY2UAiCS7sO0LfXDbivUWP1KukK75s=; b=0XLR7hG0IFJoELtIqcKTDG54aDQLHbry2XoR+5WMRHVeSuEFx76QL0uQREqsULK3dS 0RV+jlI54AQg3x8Jj4hm9ZY3owPzy1By35RyM41IZilIGI3Y/quomRf4L4gZ6HAQxOfp SuwRbj4zjDtFp38GgXXTL5LYEjA3ZmOHuUcte7QqnUG1ouOBQ0DIx9yd6Ax6U+QbHao0 zgDZNimVeVF+6XWFIdc2jjbhufyzFLQZa0REiQSpb6USpsHJtTDRMc5/TNSPFAELlD1w OaNVMHjURS+op2bt5ul4csZbUxDvJQtZafnnBSBSE8pzT4fTVZZO0Z2NjwLw7RXPdbtx qxaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si8965418ejn.161.2021.06.07.13.33.25; Mon, 07 Jun 2021 13:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231389AbhFGUcM (ORCPT + 99 others); Mon, 7 Jun 2021 16:32:12 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:8956 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbhFGUcM (ORCPT ); Mon, 7 Jun 2021 16:32:12 -0400 Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-01.qualcomm.com with ESMTP; 07 Jun 2021 13:30:20 -0700 X-QCInternal: smtphost Received: from gurus-linux.qualcomm.com ([10.134.64.25]) by ironmsg02-sd.qualcomm.com with ESMTP; 07 Jun 2021 13:30:19 -0700 Received: by gurus-linux.qualcomm.com (Postfix, from userid 383780) id A3DE4210F1; Mon, 7 Jun 2021 13:30:19 -0700 (PDT) Date: Mon, 7 Jun 2021 13:30:19 -0700 From: Guru Das Srinagesh To: Bjorn Andersson Cc: Yang Yingliang , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, lee.jones@linaro.org, agross@kernel.org, dmitry.baryshkov@linaro.org Subject: Re: [PATCH net-next v3] mfd: pm8008: Fix return value check in pm8008_probe() Message-ID: <20210607203019.GA11347@codeaurora.org> References: <20210605022446.4119978-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 05, 2021 at 10:33:44PM -0500, Bjorn Andersson wrote: > On Fri 04 Jun 21:24 CDT 2021, Yang Yingliang wrote: > > > In case of error, the function devm_regmap_init_i2c() returns ERR_PTR() > > and never returns NULL. The NULL test in the return value check > > should be replaced with IS_ERR(). > > > > Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC") > > Reported-by: Hulk Robot > > Signed-off-by: Yang Yingliang > > Reviewed-by: Bjorn Andersson Acked-by: Guru Das Srinagesh > > > --- > > v3: > > return PTR_ERR(chip->regmap) instead of ENODEV > > --- > > drivers/mfd/qcom-pm8008.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c > > index c472d7f8103c..fb8915a682ad 100644 > > --- a/drivers/mfd/qcom-pm8008.c > > +++ b/drivers/mfd/qcom-pm8008.c > > @@ -228,8 +228,8 @@ static int pm8008_probe(struct i2c_client *client) > > > > chip->dev = &client->dev; > > chip->regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg); > > - if (!chip->regmap) > > - return -ENODEV; > > + if (IS_ERR(chip->regmap)) > > + return PTR_ERR(chip->regmap); > > > > i2c_set_clientdata(client, chip); > > > > -- > > 2.25.1 > >