Skip to content

Commit 65f967b

Browse files
committed
fixup! drm/apple: Use iommu domain for piodma maps
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 205104d commit 65f967b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • drivers/gpu/drm/apple

drivers/gpu/drm/apple/dcp.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -728,17 +728,15 @@ static void dcp_work_update_backlight(struct work_struct *work)
728728
static int dcp_create_piodma_iommu_dev(struct apple_dcp *dcp)
729729
{
730730
int ret;
731-
struct device_node *node = of_get_child_by_name(dcp->dev->of_node, "piodma");
731+
struct device_node *node __free(device_node) = of_get_child_by_name(dcp->dev->of_node, "piodma");
732732

733733
if (!node)
734734
return dev_err_probe(dcp->dev, -ENODEV,
735735
"Failed to get piodma child DT node\n");
736736

737737
dcp->piodma = of_platform_device_create(node, NULL, dcp->dev);
738-
if (!dcp->piodma) {
739-
of_node_put(node);
738+
if (!dcp->piodma)
740739
return dev_err_probe(dcp->dev, -ENODEV, "Failed to create piodma pdev for %pOF\n", node);
741-
}
742740

743741
ret = dma_set_mask_and_coherent(&dcp->piodma->dev, DMA_BIT_MASK(42));
744742
if (ret)
@@ -750,7 +748,6 @@ static int dcp_create_piodma_iommu_dev(struct apple_dcp *dcp)
750748
"Failed to configure IOMMU child DMA\n");
751749
goto err_destroy_pdev;
752750
}
753-
of_node_put(node);
754751

755752
dcp->iommu_dom = iommu_get_domain_for_dev(&dcp->piodma->dev);
756753
if (IS_ERR(dcp->iommu_dom)) {
@@ -763,7 +760,6 @@ static int dcp_create_piodma_iommu_dev(struct apple_dcp *dcp)
763760

764761
return 0;
765762
err_destroy_pdev:
766-
of_node_put(node);
767763
of_platform_device_destroy(&dcp->piodma->dev, NULL);
768764
return ret;
769765
}

0 commit comments

Comments
 (0)