Skip to content

Commit

Permalink
spi: spi-gxp: Use devm_platform_ioremap_resource()
Browse files Browse the repository at this point in the history
Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.

Signed-off-by: Yang Yingliang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Yang Yingliang authored and broonie committed Sep 29, 2022
1 parent 1224e29 commit 28366dd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/spi/spi-gxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ static int gxp_spifi_probe(struct platform_device *pdev)
const struct gxp_spi_data *data;
struct spi_controller *ctlr;
struct gxp_spi *spifi;
struct resource *res;
int ret;

data = of_device_get_match_data(&pdev->dev);
Expand All @@ -269,18 +268,15 @@ static int gxp_spifi_probe(struct platform_device *pdev)
spifi->data = data;
spifi->dev = dev;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
spifi->reg_base = devm_ioremap_resource(&pdev->dev, res);
spifi->reg_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(spifi->reg_base))
return PTR_ERR(spifi->reg_base);

res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
spifi->dat_base = devm_ioremap_resource(&pdev->dev, res);
spifi->dat_base = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(spifi->dat_base))
return PTR_ERR(spifi->dat_base);

res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
spifi->dir_base = devm_ioremap_resource(&pdev->dev, res);
spifi->dir_base = devm_platform_ioremap_resource(pdev, 2);
if (IS_ERR(spifi->dir_base))
return PTR_ERR(spifi->dir_base);

Expand Down

0 comments on commit 28366dd

Please sign in to comment.