diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-06-20 10:43:43 +0800 |
---|---|---|
committer | Xinliang Liu <xinliang.liu@linaro.org> | 2016-07-04 18:49:20 +0800 |
commit | 43fd0d92300878c81ef97e8bb91074025c4acf0f (patch) | |
tree | 17addde7ac62b04504697fa34ed98dc50a14a491 /drivers/gpu/drm/hisilicon | |
parent | dac2c48ca5ac9bb2d6339aaa733c60d5b801ee86 (diff) | |
download | op-kernel-dev-43fd0d92300878c81ef97e8bb91074025c4acf0f.zip op-kernel-dev-43fd0d92300878c81ef97e8bb91074025c4acf0f.tar.gz |
drm/hisilicon: Fix return value check in ade_dts_parse()
In case of error, the function devm_clk_get() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Chen Feng <puck.chen@hisilicon.com>
Diffstat (limited to 'drivers/gpu/drm/hisilicon')
-rw-r--r-- | drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index ed76baad..16834f4 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -965,21 +965,21 @@ static int ade_dts_parse(struct platform_device *pdev, struct ade_hw_ctx *ctx) } ctx->ade_core_clk = devm_clk_get(dev, "clk_ade_core"); - if (!ctx->ade_core_clk) { + if (IS_ERR(ctx->ade_core_clk)) { DRM_ERROR("failed to parse clk ADE_CORE\n"); - return -ENODEV; + return PTR_ERR(ctx->ade_core_clk); } ctx->media_noc_clk = devm_clk_get(dev, "clk_codec_jpeg"); - if (!ctx->media_noc_clk) { + if (IS_ERR(ctx->media_noc_clk)) { DRM_ERROR("failed to parse clk CODEC_JPEG\n"); - return -ENODEV; + return PTR_ERR(ctx->media_noc_clk); } ctx->ade_pix_clk = devm_clk_get(dev, "clk_ade_pix"); - if (!ctx->ade_pix_clk) { + if (IS_ERR(ctx->ade_pix_clk)) { DRM_ERROR("failed to parse clk ADE_PIX\n"); - return -ENODEV; + return PTR_ERR(ctx->ade_pix_clk); } return 0; |