Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2030275img; Sat, 23 Mar 2019 20:35:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBas5Xi/fMoGPMj4kxlnQ0UNy3mbTvJ5Z/vFvt6GGI05ifxuzpKtyu/r4VPEyEe1gqBVwh X-Received: by 2002:a17:902:123:: with SMTP id 32mr17901514plb.187.1553398548949; Sat, 23 Mar 2019 20:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553398548; cv=none; d=google.com; s=arc-20160816; b=uPFR1qlSWLsuGJlogpslv4PZOfMvKXgWN889FSUEkN7BtBv08XBjknnlLaV35ZkMqP LoGEupcz3IigVFkUz1q0VAYYLjJ/Cxzj9gqpof7+fNHriqEoo6/TGG79D/sSAAALIkXY dqH1mvuGpZNf9xB+8z7UXYOQKXgnHZNIWkRMobmqK0LhLPY9u/enu374hfBSlD/2Xu5e bmZ3YE4TVZTLnE8MQVejlujwf+AHftRyie51gPx6oULc9j8Sj/CynIp6Y/f9XSD4CkiW P37Ft01VLsFmVQXo61g//p4JLIkYlpPkR9gtlUnNkt4XIoY78BXSDZA4d58y6rfVRrO8 kEiA== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Q+TixpZZDrIwfWP/WiIM21CJ4YMLX34nzy2GsH4f01Q=; b=uDKByITWbw6+WuL+Ctf9CP0Kxc1RHSoBzbHRvzrZcQjHk5Fp2dOMa6k6ZaSyZ+NLCd DBZIEpPixF7FwkxUzB7XVhIzS829cziXB92K3XYTe7XrrgtbTjIs1M00y2YHwKr52C5Y zYipdodVDQXRztCgHAyThGCtLr5GmBuGVGiGbj+8LR3IPBTw/kG7/4o4ndpKneAgnW3l 1b1jg0uwD79bzVUDyeIOZ8XNXIqSNFnaYZfzhMfP1jC+268EF1GPQg5l0sgqvaKmrwiH Xg5AsG8nqUlauYb+96ntDeisU4y7AM6+CHeOEDAZSQl68fLz5pFi11I9KhPDq+3ClMEA 0lqw== 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 w21si10640278pga.0.2019.03.23.20.35.34; Sat, 23 Mar 2019 20:35:48 -0700 (PDT) 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 S1728043AbfCXDes (ORCPT + 99 others); Sat, 23 Mar 2019 23:34:48 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:1799 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727706AbfCXDer (ORCPT ); Sat, 23 Mar 2019 23:34:47 -0400 X-UUID: 4139318f1e5040d8bdad11c93286e163-20190324 X-UUID: 4139318f1e5040d8bdad11c93286e163-20190324 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1396306676; Sun, 24 Mar 2019 11:34:29 +0800 Received: from MTKMBS01DR.mediatek.inc (172.21.101.111) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 24 Mar 2019 11:34:27 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs01dr.mediatek.inc (172.21.101.111) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 24 Mar 2019 11:34:26 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sun, 24 Mar 2019 11:34:26 +0800 Message-ID: <1553398466.26628.0.camel@mtksdaap41> Subject: Re: [PATCH 09/24] mmc: mtk-sd: check for valid optional memory resource From: Yingjoe Chen To: Fabien Parent CC: , , , , , , , , , , , , , , , , , , , , , Date: Sun, 24 Mar 2019 11:34:26 +0800 In-Reply-To: <20190323211612.860-10-fparent@baylibre.com> References: <20190323211612.860-1-fparent@baylibre.com> <20190323211612.860-10-fparent@baylibre.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N X-TM-SNTS-SMTP: 054869C2B2FF6DCD1AFCF49E6578D95B61694A9C9726265AD53ECF398AE763E82000:8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2019-03-23 at 22:15 +0100, Fabien Parent wrote: > 'top_base' memory region is optional. Check that the resource is valid > before using it. This avoid getting a "invalid resource" error message > printed by the kernel. > > Signed-off-by: Fabien Parent > --- > drivers/mmc/host/mtk-sd.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c > index 833ef0590af8..573aa127d00b 100644 > --- a/drivers/mmc/host/mtk-sd.c > +++ b/drivers/mmc/host/mtk-sd.c > @@ -2123,9 +2123,11 @@ static int msdc_drv_probe(struct platform_device *pdev) > } > > res = platform_get_resource(pdev, IORESOURCE_MEM, 1); > - host->top_base = devm_ioremap_resource(&pdev->dev, res); > - if (IS_ERR(host->top_base)) > - host->top_base = NULL; > + if (ret) { This should be res? > + host->top_base = devm_ioremap_resource(&pdev->dev, res); > + if (IS_ERR(host->top_base)) > + host->top_base = NULL; > + } > > ret = mmc_regulator_get_supply(mmc); > if (ret)