Skip to content

Commit badd019

Browse files
bbkzzmiquelraynal
authored andcommitted
mtd: spear_smi: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230707040622.78174-17-frank.li@vivo.com
1 parent 1726813 commit badd019

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/mtd/devices/spear_smi.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,6 @@ static int spear_smi_probe(struct platform_device *pdev)
937937
struct device_node *np = pdev->dev.of_node;
938938
struct spear_smi_plat_data *pdata = NULL;
939939
struct spear_smi *dev;
940-
struct resource *smi_base;
941940
int irq, ret = 0;
942941
int i;
943942

@@ -975,9 +974,7 @@ static int spear_smi_probe(struct platform_device *pdev)
975974
goto err;
976975
}
977976

978-
smi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
979-
980-
dev->io_base = devm_ioremap_resource(&pdev->dev, smi_base);
977+
dev->io_base = devm_platform_ioremap_resource(pdev, 0);
981978
if (IS_ERR(dev->io_base)) {
982979
ret = PTR_ERR(dev->io_base);
983980
goto err;

0 commit comments

Comments
 (0)