aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunyan Zhang <[email protected]>2021-03-31 11:16:45 +0800
committerJoerg Roedel <[email protected]>2021-04-07 10:43:49 +0200
commita56af062ae7cdc9759ed61d1d3d173f28c79510a (patch)
tree8a367786f35cd900b7c53e6dddbd76f9377a2e2d
parent0bb868e1e3c16827c1b63589b1b0f016ba00140d (diff)
iommu/sprd: Fix parameter type warning
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. Reported-by: kernel test robot <[email protected]> Signed-off-by: Chunyan Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
-rw-r--r--drivers/iommu/sprd-iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c
index e1dc2f7d5639..3811a5085b50 100644
--- a/drivers/iommu/sprd-iommu.c
+++ b/drivers/iommu/sprd-iommu.c
@@ -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;