diff options
author | Cai Huoqing <caihuoqing@baidu.com> | 2021-09-01 10:42:22 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2021-09-14 20:34:56 +0300 |
commit | 8d77c55f090def05f450df8aa6ee16ec6f4d01ba (patch) | |
tree | f91f1edb6ce3ef085f2653cbb8ec358a9161cb6c /drivers/mtd/nand | |
parent | 7e2561430dff0a1bb9ab794e70fcaa56852e10f9 (diff) | |
download | linux-8d77c55f090def05f450df8aa6ee16ec6f4d01ba.tar.xz |
mtd: rawnand: stm32_fmc2: Make use of the helper function devm_platform_ioremap_resource()
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Christophe Kerello <christophe.kerello@foss.st.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210901074222.9433-1-caihuoqing@baidu.com
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/raw/stm32_fmc2_nand.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c index 1c277fbb91f2..97b4e02e43e4 100644 --- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c +++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c @@ -1899,15 +1899,11 @@ static int stm32_fmc2_nfc_probe(struct platform_device *pdev) nfc->data_phys_addr[chip_cs] = res->start; - res = platform_get_resource(pdev, IORESOURCE_MEM, - mem_region + 1); - nfc->cmd_base[chip_cs] = devm_ioremap_resource(dev, res); + nfc->cmd_base[chip_cs] = devm_platform_ioremap_resource(pdev, mem_region + 1); if (IS_ERR(nfc->cmd_base[chip_cs])) return PTR_ERR(nfc->cmd_base[chip_cs]); - res = platform_get_resource(pdev, IORESOURCE_MEM, - mem_region + 2); - nfc->addr_base[chip_cs] = devm_ioremap_resource(dev, res); + nfc->addr_base[chip_cs] = devm_platform_ioremap_resource(pdev, mem_region + 2); if (IS_ERR(nfc->addr_base[chip_cs])) return PTR_ERR(nfc->addr_base[chip_cs]); } |