Skip to content

Commit

Permalink
drivers/spi-rockchip.c : Use devm_platform_get_and_ioremap_resource m…
Browse files Browse the repository at this point in the history
…akes code better

use devm_platform_get_and_ioremap replace platform_get_resource()
and devm_ioremap_resource()

Signed-off-by: Lizhe <sensor1010@163.com>
Link: https://lore.kernel.org/r/20230226065125.14086-1-sensor1010@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Lizhe authored and Mark Brown committed Mar 5, 2023
1 parent f58ab0f commit d447fa6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/spi/spi-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
ctlr->slave = slave_mode;

/* Get basic io resource and map it */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rs->regs = devm_ioremap_resource(&pdev->dev, mem);
rs->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(rs->regs)) {
ret = PTR_ERR(rs->regs);
goto err_put_ctlr;
Expand Down

0 comments on commit d447fa6

Please sign in to comment.