Skip to content

Commit b1042a7

Browse files
Yang Likwilczynski
authored andcommitted
PCI: xgene-msi: Use devm_platform_get_and_ioremap_resource()
Convert calls to platform_get_resource() and devm_ioremap_resource() into a single call to devm_platform_get_and_ioremap_resource(), to simplify the code. This new helper added in commit 890cc39 ("drivers: provide devm_platform_get_and_ioremap_resource()") does what both of the other separate functions do. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20230323090011.66754-1-yang.lee@linux.alibaba.com Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
1 parent 88f29ab commit b1042a7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/pci/controller/pci-xgene-msi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
441441

442442
platform_set_drvdata(pdev, xgene_msi);
443443

444-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
445-
xgene_msi->msi_regs = devm_ioremap_resource(&pdev->dev, res);
444+
xgene_msi->msi_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
446445
if (IS_ERR(xgene_msi->msi_regs)) {
447446
rc = PTR_ERR(xgene_msi->msi_regs);
448447
goto error;

0 commit comments

Comments
 (0)