From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Elfring Date: Thu, 19 Sep 2019 10:50:28 +0000 Subject: Re: [PATCH] mtd: st_spi_fsm: Use devm_platform_ioremap_resource() in stfsm_probe() Message-Id: <17a1fccd-0ac3-f257-dec9-228b33a18cfa@web.de> List-Id: References: <20190919111014.6c569cf3@xps13> In-Reply-To: <20190919111014.6c569cf3@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Miquel Raynal , linux-mtd@lists.infradead.org Cc: Vignesh Raghavendra , Bartosz Golaszewski , Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, LKML , Marek Vasut , Armijn Hemel , Himanshu Jha , Richard Weinberger , Lee Jones , Brian Norris , David Woodhouse , Thomas Gleixner , Allison Randal >> +++ b/drivers/mtd/devices/st_spi_fsm.c >> @@ -2034,13 +2034,7 @@ static int stfsm_probe(struct platform_device *pdev) >> >> platform_set_drvdata(pdev, fsm); >> >> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> - if (!res) { >> - dev_err(&pdev->dev, "Resource not found\n"); >> - return -ENODEV; >> - } >> - >> - fsm->base = devm_ioremap_resource(&pdev->dev, res); >> + fsm->base = devm_platform_ioremap_resource(pdev, 0); >> if (IS_ERR(fsm->base)) { >> dev_err(&pdev->dev, >> "Failed to reserve memory region %pR\n", res); >> -- >> 2.23.0 >> > > > Is this even compiled tested? 'res' is not initialized anymore so you > can't use it in the error trace. I suppose you should even drop it from > the stack parameters. Would you accept to reduce the error message another bit? Regards, Markus