aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-10-25 05:07:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-29 12:05:21 -0400
commit2eaaccdeabf34ad70ecb7eb9c4aafa08b13a0e66 (patch)
tree40ca79a9de0113add562e5e66743d605011286a3
parent95fd62a1174306d53f529e73a9713764072cc511 (diff)
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/imx-drm/imx-drm-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
index d2fb699c0d1d..4483d47f7395 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -852,8 +852,8 @@ static int __init imx_drm_init(void)
852 INIT_LIST_HEAD(&imx_drm_device->encoder_list); 852 INIT_LIST_HEAD(&imx_drm_device->encoder_list);
853 853
854 imx_drm_pdev = platform_device_register_simple("imx-drm", -1, NULL, 0); 854 imx_drm_pdev = platform_device_register_simple("imx-drm", -1, NULL, 0);
855 if (!imx_drm_pdev) { 855 if (IS_ERR(imx_drm_pdev)) {
856 ret = -EINVAL; 856 ret = PTR_ERR(imx_drm_pdev);
857 goto err_pdev; 857 goto err_pdev;
858 } 858 }
859 859