spi: npcm-fiu: Use 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: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20221029071529.3019626-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
93cc2559d3
commit
1793d36672
|
@ -699,7 +699,6 @@ static int npcm_fiu_probe(struct platform_device *pdev)
|
|||
struct spi_controller *ctrl;
|
||||
struct npcm_fiu_spi *fiu;
|
||||
void __iomem *regbase;
|
||||
struct resource *res;
|
||||
int id, ret;
|
||||
|
||||
ctrl = devm_spi_alloc_master(dev, sizeof(*fiu));
|
||||
|
@ -725,8 +724,7 @@ static int npcm_fiu_probe(struct platform_device *pdev)
|
|||
platform_set_drvdata(pdev, fiu);
|
||||
fiu->dev = dev;
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
|
||||
regbase = devm_ioremap_resource(dev, res);
|
||||
regbase = devm_platform_ioremap_resource_byname(pdev, "control");
|
||||
if (IS_ERR(regbase))
|
||||
return PTR_ERR(regbase);
|
||||
|
||||
|
|
Loading…
Reference in New Issue