Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5689584yba; Thu, 11 Apr 2019 03:44:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxx2NwynzpYLZINyXciPtyP1MRPiHBRYnyR18Y/OslyfT6fyiFdPnuuapuBU13PvRxyGy04 X-Received: by 2002:a63:6942:: with SMTP id e63mr46820005pgc.102.1554979492901; Thu, 11 Apr 2019 03:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554979492; cv=none; d=google.com; s=arc-20160816; b=zSaIYsDFvBpSpe+6PfgBz7uxZl7BFBnHIlJnqyccy5NxMoVibhA7By2uR20Bzfa1Fk JNe4OefWcanRAGuDyHAigVzlK6agTSBQdH16j6mFF7yKV1C6dd1X6Isk02fWRJ7p7klq LV8fUOEIYgSBqnbEaH7JmPP6h10V1qpGIe+/hOIcxytjfvYavABoI98w2Rfnbmcx3MLV J7onnqYJbaHZaAKpy9uY6nXPZAfZsRdoXmgKAByZRJP14zdnk4Qh1ULmjNphjbtAvcyM 2wEDtnG35HECgFqNBiPl3/oH1vQxiYavg+9xstYrp61jPPk8nAPiAOYw05WxHSCXzF3S Ulhg== 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=WLOKfUksx4CoR+vUiDn8/P6m64a24gTDOgWcpsMihPs=; b=gZuvjxbDFgsLboe+pqUuMURqFfkwWo3+rkzv0bLuR2FhZBVWhqna0fdSIARTs0xBMd QRHhjsWURit2mmbyeDouoVyskN0PWicBer3DOE5sZQnEvRAHA+Jd+6P748FmwPFU4GZj cOOkZQhhCLLz64RXQPa2p1h22nWwAzpBF6NNXQOOZ4xEZU8sclxUVp3A0Pn2y7mLemcQ d2f0vie7kkCEgFutw1oF8tY/yjJ1BCOT4loJPSozZmqsYrd1uKxDHNZnpdd6zd4RkZGf hrGTstdXT+Vwjfxd8soA2fjrZsIstCPRJfKx15Jy6bpBAcRebti+93EhhMIRzOrXWoo4 UaXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XIrP9hh9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si26022614plo.101.2019.04.11.03.44.36; Thu, 11 Apr 2019 03:44:52 -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=@linaro.org header.s=google header.b=XIrP9hh9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726742AbfDKKnv (ORCPT + 99 others); Thu, 11 Apr 2019 06:43:51 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:33910 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726615AbfDKKnu (ORCPT ); Thu, 11 Apr 2019 06:43:50 -0400 Received: by mail-vs1-f66.google.com with SMTP id t78so3206459vsc.1 for ; Thu, 11 Apr 2019 03:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WLOKfUksx4CoR+vUiDn8/P6m64a24gTDOgWcpsMihPs=; b=XIrP9hh9WndJnJg5Hu16WIWQQmql5H9f51UGF8Qlv8EWhNN2qiF/UwB4Gu1Ncmuy9m PigZOa0JSwIMEkF0z48NfNqFk1ik5WkEV3yUqJ96MAUnuHCgdW9ca3lEjETtQiHfqOSq jdW5K2xKy7ZDbwQfCoBUWJbTNVUbj3FLdctO/8LqRQhSupFAzF6TkVqfKsA2XnV48CQw TsIXFWHu1aiirFgF0+mNlrnIm5NASEUvt5IPk2JE3HxjKT6el0dnc3luZLfoOKbiHnxe TRjiqIBOyL/1xoNyfpQTr2jrzolOTTqPg6cEuaGkuUhY7rDKSvpbjhJO/U6OTsxIe5Hc M8bA== 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=WLOKfUksx4CoR+vUiDn8/P6m64a24gTDOgWcpsMihPs=; b=mSM7FrcVxCzlGQfbXuAtY1C6I4tiBZj0atrW1tdQD+vDMwJDIkttCiCrnET0j+/0HJ OKn4XG0qsKngXuYFJrlHHOyMnJPO9lWkTwD5JRrKd9oeN6jVZEjBMOxuGP/M9FAT67bZ G6mh6e3K6QZUbtkT93MyOTHqwkwVS2zxVJfSL1hHKL/VBJwIFyTml4hMQUnXoC4Rnc9u O8zhv4CFo7zVe1ACuAHVMBG5MmZZTK8hJ+1Uxu7N5wdhR2cqTgS50XYIDaQ99nv7u7zz IKgqFencaU8D4hQ+Qbx24llvYyfPCEjknDStKsD+373tW8QJ0YSBkNrkuhTLW+wof+Mu ZiRA== X-Gm-Message-State: APjAAAXEuoqw8oayAAMpwuAAsj6srTl4+6qagLpm9zRPwU5CYv7c4Tx3 2Aytc4rW3v/VLAk5MLyQtFvRSSy0wlxjAdhynpwLSg== X-Received: by 2002:a67:fa04:: with SMTP id i4mr27531604vsq.18.1554979429381; Thu, 11 Apr 2019 03:43:49 -0700 (PDT) MIME-Version: 1.0 References: <20190403193050.22180-1-fparent@baylibre.com> In-Reply-To: <20190403193050.22180-1-fparent@baylibre.com> From: Ulf Hansson Date: Thu, 11 Apr 2019 12:43:13 +0200 Message-ID: Subject: Re: [PATCH v2] mmc: mtk-sd: check for valid optional memory resource To: Fabien Parent Cc: Matthias Brugger , Yingjoe Chen , Chaotian Jing , Ryder Lee , Jjian Zhou , "linux-mmc@vger.kernel.org" , Linux ARM , linux-mediatek@lists.infradead.org, Linux Kernel Mailing List 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 Wed, 3 Apr 2019 at 21:31, 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 Applied for next, thanks! Kind regards Uffe > --- > > V2: > Fix invalid condition: check against 'res' variable instead of 'ret'. > > --- > 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..61bf8704491c 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 (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) > -- > 2.20.1 >