Skip to contentSkip to conversation

iommu: sprd: Fix parameter type warning

PATCH In review Chunyan Zhang 2 participants 2 messages Mar 31, 2021 – Apr 7, 2021

Subsystems (2)
lore
Share & tools
lore

Chunyan Zhang

author reviewer
#0 lore raw

PATCH 1/1 iommu: sprd: Fix parameter type warning

From: Chunyan Zhang <[email protected]>

The second parameter of clk_get_optional() is "const char *", so use NULL instead of integer 0 to fix a sparse warning like:

">> drivers/iommu/sprd-iommu.c:456:42: sparse: sparse: Using plain integer as NULL pointer"

Also this patch changes to use the resource-managed variant of clk_get_optional(), then there's no need to add clk_put() which is missed in the current driver.

---
 drivers/iommu/sprd-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/sprd-iommu.c +1 -1
index 7100ed17dcce..371d5715cbc9 100644
@@ -453,7 +453,7 @@ static int sprd_iommu_clk_enable(struct sprd_iommu_device *sdev)
 {
 	struct clk *eb;
 
-	eb = clk_get_optional(sdev->dev, 0);
+	eb = devm_clk_get_optional(sdev->dev, NULL);
 	if (!eb)
 		return 0;
 
Signature · 6 lines
2.25.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu