Skip to content

Commit 2f8c7f2

Browse files
mmindjoergroedel
authored andcommitted
iommu/rockchip: Make clock handling optional
iommu clocks are optional, so the driver should not fail if they are not present. Instead just set the number of clocks to 0, which the clk-blk APIs can handle just fine. Fixes: f2e3a5f ("iommu/rockchip: Control clocks needed to access the IOMMU") Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Tested-by: Enric Balletbo i Serra <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 94c793a commit 2f8c7f2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/iommu/rockchip-iommu.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,8 +1175,15 @@ static int rk_iommu_probe(struct platform_device *pdev)
11751175
for (i = 0; i < iommu->num_clocks; ++i)
11761176
iommu->clocks[i].id = rk_iommu_clocks[i];
11771177

1178+
/*
1179+
* iommu clocks should be present for all new devices and devicetrees
1180+
* but there are older devicetrees without clocks out in the wild.
1181+
* So clocks as optional for the time being.
1182+
*/
11781183
err = devm_clk_bulk_get(iommu->dev, iommu->num_clocks, iommu->clocks);
1179-
if (err)
1184+
if (err == -ENOENT)
1185+
iommu->num_clocks = 0;
1186+
else if (err)
11801187
return err;
11811188

11821189
err = clk_bulk_prepare(iommu->num_clocks, iommu->clocks);

0 commit comments

Comments
 (0)