Commit d447fa65 authored by Lizhe's avatar Lizhe Committed by Mark Brown

drivers/spi-rockchip.c : Use devm_platform_get_and_ioremap_resource makes code better

use devm_platform_get_and_ioremap replace platform_get_resource()
and devm_ioremap_resource()
Signed-off-by: default avatarLizhe <sensor1010@163.com>
Link: https://lore.kernel.org/r/20230226065125.14086-1-sensor1010@163.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f58ab0fa
...@@ -775,8 +775,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) ...@@ -775,8 +775,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
ctlr->slave = slave_mode; ctlr->slave = slave_mode;
/* Get basic io resource and map it */ /* Get basic io resource and map it */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); rs->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
rs->regs = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(rs->regs)) { if (IS_ERR(rs->regs)) {
ret = PTR_ERR(rs->regs); ret = PTR_ERR(rs->regs);
goto err_put_ctlr; goto err_put_ctlr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment