[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFrKxGxp5K38P-AHrRpjOGjKhBv333HXAHPNKYWqLJmz+g@mail.gmail.com>
Date: Thu, 11 Apr 2019 12:43:13 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Fabien Parent <fparent@...libre.com>
Cc: Matthias Brugger <matthias.bgg@...il.com>,
Yingjoe Chen <yingjoe.chen@...iatek.com>,
Chaotian Jing <chaotian.jing@...iatek.com>,
Ryder Lee <ryder.lee@...iatek.com>,
Jjian Zhou <jjian.zhou@...iatek.com>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-mediatek@...ts.infradead.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] mmc: mtk-sd: check for valid optional memory resource
On Wed, 3 Apr 2019 at 21:31, Fabien Parent <fparent@...libre.com> 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 <fparent@...libre.com>
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
>
Powered by blists - more mailing lists