提交 a56af062 编写于 作者: C Chunyan Zhang 提交者: Joerg Roedel

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: Nkernel test robot <lkp@intel.com>
Signed-off-by: NChunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20210331031645.1001913-1-zhang.lyra@gmail.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
上级 0bb868e1
...@@ -453,7 +453,7 @@ static int sprd_iommu_clk_enable(struct sprd_iommu_device *sdev) ...@@ -453,7 +453,7 @@ static int sprd_iommu_clk_enable(struct sprd_iommu_device *sdev)
{ {
struct clk *eb; struct clk *eb;
eb = clk_get_optional(sdev->dev, 0); eb = devm_clk_get_optional(sdev->dev, NULL);
if (!eb) if (!eb)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册