From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulf Hansson Subject: Re: [PATCH 09/24] mmc: mtk-sd: check for valid optional memory resource Date: Mon, 25 Mar 2019 14:26:53 +0100 Message-ID: References: <20190323211612.860-1-fparent@baylibre.com> <20190323211612.860-10-fparent@baylibre.com> <1553398466.26628.0.camel@mtksdaap41> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+glpam-linux-mediatek=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Fabien Parent Cc: "linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Yong Mao , linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Matthias Brugger , Yingjoe Chen , Chaotian Jing List-Id: linux-mmc@vger.kernel.org -- trimmed cc-list On Sun, 24 Mar 2019 at 16:18, Fabien Parent wrote: > > On Sun, Mar 24, 2019 at 4:34 AM Yingjoe Chen wrote: > > > > 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 For the next version, please post it as a standalone patch and trim the cc/to list. Then I can pick it up. Kind regards Uffe > > > --- > > > 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? > > Indeed. Thanks, I will fix it in v2. > > > > + 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) > > > >