Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4588747imb; Wed, 6 Mar 2019 17:46:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyWJiLRbsfrZmQZ9dvQQRfavCiCk7ijZKxQI3ORyJDVqKbAVOEEEAoRh4BMNrpRz++XAKhW X-Received: by 2002:a63:8bc7:: with SMTP id j190mr9204758pge.382.1551923193191; Wed, 06 Mar 2019 17:46:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551923193; cv=none; d=google.com; s=arc-20160816; b=TK72ndxBIFbGaFABg6xvQHWxQElMLWlK3+OH1B91l9A77Gby5LZ/U1Nldh7tRfFGrm gXpr9Dg5m6NnOxip9SrKvadfz3EmM1V1oTbkmb9/bZggVnxxu4phhmkw0oPqZ7451+xZ CgtStdNeixuGmZYnn2XXSWJnLY8ScHOV074QcFAK6sK3o9ML//wmDVEW1AtGurESTBBk pejog5bFcur1xp0TaqoiHyyXrKgZmbXUB7tifAJjmn06C4ajXqo8vfq3G8QEGIRFkgOV wkC5rSaOizF9eyulLpbr90mb10x95Fu5QN0z6ebgiosCq6KZeMaI0XCQYBJqdW30xYCx bTIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=fOy/EozIbCL7rbDNAvWIVS6cP9I0/st9OXY9vdLPKts=; b=nzpBgXliCVj4e2eHGLe+o8131PgLlG2aSUnSaKSLSxX8hvq0V7lluuSI4NG9BOYz9x nr1/SkO1F6vYXWEXdPpaBviXx2igI1JKX2iKP9c6VmcoLIWaBERJU+UEgtlwKjQIQdQH QxvbIdd7UbI+cb9HWeRfb9LWDzjLWlctbaLJqU7QQBRB47SlvxuEmUScsySK/LZzhpYw 6LRP7voqmbeqXF9Bqwg1rIGWeRjdV26P/7002Q6PeU4oaUPiE6Q/aCGLcs4HN/9GR65p 51N3HTMUOTRH+pLskySzC2qjuUtSwVgw5n3ehzJByyr9JTJ5RKlb5r1+it5zehuDHMgn vELA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u84si3228202pfj.2.2019.03.06.17.46.18; Wed, 06 Mar 2019 17:46:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726532AbfCGBo0 (ORCPT + 99 others); Wed, 6 Mar 2019 20:44:26 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:4654 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726010AbfCGBo0 (ORCPT ); Wed, 6 Mar 2019 20:44:26 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B0DD2119F7FAE2E915D2; Thu, 7 Mar 2019 09:44:23 +0800 (CST) Received: from [127.0.0.1] (10.142.193.64) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.408.0; Thu, 7 Mar 2019 09:44:20 +0800 Subject: Re: [PATCH] mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk To: Axel Lin , Lee Jones References: <20190306134949.31883-1-axel.lin@ingics.com> CC: From: Chen Feng Message-ID: <5C80776F.4070806@hisilicon.com> Date: Thu, 7 Mar 2019 09:44:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20190306134949.31883-1-axel.lin@ingics.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.193.64] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks On 2019/3/6 21:49, Axel Lin wrote: > Since devm_regmap_init_mmio_clk can fail, add return value checking. > > Signed-off-by: Axel Lin > --- > drivers/mfd/hi655x-pmic.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/mfd/hi655x-pmic.c b/drivers/mfd/hi655x-pmic.c > index 96c07fa1802a..6693f74aa6ab 100644 > --- a/drivers/mfd/hi655x-pmic.c > +++ b/drivers/mfd/hi655x-pmic.c > @@ -112,6 +112,8 @@ static int hi655x_pmic_probe(struct platform_device *pdev) > > pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base, > &hi655x_regmap_config); > + if (IS_ERR(pmic->regmap)) > + return PTR_ERR(pmic->regmap); > > regmap_read(pmic->regmap, HI655X_BUS_ADDR(HI655X_VER_REG), &pmic->ver); > if ((pmic->ver < PMU_VER_START) || (pmic->ver > PMU_VER_END)) { > -- Cheers, - Feng