Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2423747img; Sun, 24 Mar 2019 08:19:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtCsdsEO2wWclhbvv5MjvwacHue5Yk2kZlAqVHIZm6Bv7/R5zpCpalHQ7QCP6aZCFRTdJc X-Received: by 2002:a17:902:8644:: with SMTP id y4mr19622049plt.99.1553440786119; Sun, 24 Mar 2019 08:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553440786; cv=none; d=google.com; s=arc-20160816; b=Od3R2QpWMmKRjLl6bkA/JoUYzMyRFYPKcpo+wC5j+Cq43fpXQ7b/40K4glySvG/xUy dAhl/BMs2eegGXfRgsVn1EBef3a6cZVoZ3q4a5ldSpvZYlWYQ96kklXuYqNFLJx8gtzn PN5VHEND6MDmG0zgYPADtjbSXtdsYXZ089QDgI4ajd3o039zJjhLFgvsY+zKVQGiYyVD gvHyTYkOREgV1fQsggBkBdzlqIHyeRVP/qUQFVrPqHixa8K/erl28U7lQoz4HQyC5rNg xpiH1nHRp53nWePHpiG1GMVUZbCQQ5SOvQ7AKKDF4Qzl2+mYswLJIF+u+MX1SoueE7iq gFZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LA6GXUCgoW4lEEmR/LMufysHJYXyTKx9RuJsaqKLxUA=; b=mUuibsfgz/AZp4cfrSml5iC6wR3Ppj+xdoF6VYX6KQTlR5OM9X7XJLxmzWpRHu63L9 yrsQAIkKwje8JHGQDWlewySZvJFyUJSDBT2pilZy7PfUyUJmFwP1nNkUpVw+vhDUSlMD 8MfW3emdr/xLvDxTRAoIFrmUxgfUHuqICS/8f+iKBtT6Uc8kp3vStLVi12tLBK/oowub uM3so4bwBO68fqkkzIWQS5doUFhfC8GGu5MJlathhT/ekU+ydJpKaNztOXq8aUaGY4F4 RcS+4v2AeJzTbp3Bhwl3XyykTxQR4tsx7Ogi6yjc1O5V2WVOoJPHqRCcG1hevmokc5oK 6aIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="mQUHe/2T"; 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 e5si12277785plb.426.2019.03.24.08.19.30; Sun, 24 Mar 2019 08:19:46 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="mQUHe/2T"; 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 S1728710AbfCXPS5 (ORCPT + 99 others); Sun, 24 Mar 2019 11:18:57 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:34039 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbfCXPS5 (ORCPT ); Sun, 24 Mar 2019 11:18:57 -0400 Received: by mail-it1-f196.google.com with SMTP id l4so5078831ite.1 for ; Sun, 24 Mar 2019 08:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LA6GXUCgoW4lEEmR/LMufysHJYXyTKx9RuJsaqKLxUA=; b=mQUHe/2T27VeYzPtkFZWO1opnsxSqurAU0juAhv8EYg793y8UFMp/YczASj+Er6Z3r e85zNaO4H+71QAWIfcCYz9gh+g0W9X1kULySVZDNKRZaI1YDpVgkgR8dXUxaqWkBbwCA b35aoGlfuXQBqmOsZNDNvK4+SjOE6mzMHAA8iFANLLbsDkfFqmPmQFJNuAcYbqcHVxKW xglcSytksG3tFjvpVEh/g05uCObI7wJhkJasPFgnE2sKeGtJKZ+jBe78z3xlUTRDKpX3 P8ubfmY3jOhP2iixXc7eyPmcN+N1D0dq2Jge/QydJky8x8i4g52kQPlD7baUo7XgyeAx FCIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LA6GXUCgoW4lEEmR/LMufysHJYXyTKx9RuJsaqKLxUA=; b=gfYntPBlhS5gOgJLOl0Lqiw94Lqp/V4q0j4PSzaB2+DRzUNKR+iu1Hm2VVYYc72L6e OUjxG/Z+BsVWo0I7TjmVST+jYSi/bY8rr6D6UhPeU797Q6zql18LdgbL87iqxuz6XqO/ c8f+QSFW6D7LHYATensEbPTMLSFMm46ANF7cgeuVucSYkRv3pqj0R40YnaB6zJcXGcax 1xbvwnLFxBO0EZEZNOmAmidq3bl1+cv7qT+U7PgbWiB7ipqk8wHMuFHz+tFU/jpXi2Xw JTNUiF4ATXU27JuLBD7adjPpDMPNODBWIHDIm2r07yGVsg3EvnVyIkhLkiciNx4YWu9w g4BQ== X-Gm-Message-State: APjAAAUNl/ZC/EqgIcZ5DrUeL/EqufniMExD/cPfzYTW9qX3CzHqVcwd V/LGVmVdxY0dU3hMrVs2JBm/X8ikYWCMgcEHYcoE2g== X-Received: by 2002:a24:3c4c:: with SMTP id m73mr8815805ita.23.1553440736289; Sun, 24 Mar 2019 08:18:56 -0700 (PDT) MIME-Version: 1.0 References: <20190323211612.860-1-fparent@baylibre.com> <20190323211612.860-10-fparent@baylibre.com> <1553398466.26628.0.camel@mtksdaap41> In-Reply-To: <1553398466.26628.0.camel@mtksdaap41> From: Fabien Parent Date: Sun, 24 Mar 2019 16:18:45 +0100 Message-ID: Subject: Re: [PATCH 09/24] mmc: mtk-sd: check for valid optional memory resource To: Yingjoe Chen Cc: Matthias Brugger , robh+dt@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, ryder.lee@mediatek.com, linux-watchdog@vger.kernel.org, jjian.zhou@mediatek.com, wenzhen.yu@mediatek.com, Stephane Le Provost , sean.wang@kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, yong.mao@mediatek.com, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-mediatek@lists.infradead.org, hsin-hsiung.wang@mediatek.com, linux-serial@vger.kernel.org, linux-clk@vger.kernel.org, Chaotian Jing , linux-i2c@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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) > >