Commit 2eaaccde authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

staging: drm/imx: fix return value check in imx_drm_init()

In case of error, the function platform_device_register_simple() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 95fd62a1
......@@ -852,8 +852,8 @@ static int __init imx_drm_init(void)
INIT_LIST_HEAD(&imx_drm_device->encoder_list);
imx_drm_pdev = platform_device_register_simple("imx-drm", -1, NULL, 0);
if (!imx_drm_pdev) {
ret = -EINVAL;
if (IS_ERR(imx_drm_pdev)) {
ret = PTR_ERR(imx_drm_pdev);
goto err_pdev;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment