mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
mtd: spi-nor: hisi-sfc: Make use of the helper function devm_platform_ioremap_resource_byname()
Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Acked-by: Pratyush Yadav <p.yadav@ti.com> Link: https://lore.kernel.org/r/20210901074259.9683-1-caihuoqing@baidu.com
This commit is contained in:
parent
78e4d34218
commit
a10ed4c425
1 changed files with 2 additions and 5 deletions
|
@ -421,7 +421,6 @@ static int hisi_spi_nor_register_all(struct hifmc_host *host)
|
|||
static int hisi_spi_nor_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct resource *res;
|
||||
struct hifmc_host *host;
|
||||
int ret;
|
||||
|
||||
|
@ -432,13 +431,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
|
|||
platform_set_drvdata(pdev, host);
|
||||
host->dev = dev;
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
|
||||
host->regbase = devm_ioremap_resource(dev, res);
|
||||
host->regbase = devm_platform_ioremap_resource_byname(pdev, "control");
|
||||
if (IS_ERR(host->regbase))
|
||||
return PTR_ERR(host->regbase);
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
|
||||
host->iobase = devm_ioremap_resource(dev, res);
|
||||
host->iobase = devm_platform_ioremap_resource_byname(pdev, "memory");
|
||||
if (IS_ERR(host->iobase))
|
||||
return PTR_ERR(host->iobase);
|
||||
|
||||
|
|
Loading…
Reference in a new issue