drm: sti: Fix return value check in sti_drm_platform_probe()

In case of error, the function platform_device_register_resndata()
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>
This commit is contained in:
Wei Yongjun 2014-08-26 12:24:24 +02:00 коммит произвёл Benjamin Gaignard
Родитель 5024a2b7ae
Коммит eacd9aa98b
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -201,8 +201,8 @@ static int sti_drm_platform_probe(struct platform_device *pdev)
master = platform_device_register_resndata(dev, master = platform_device_register_resndata(dev,
DRIVER_NAME "__master", -1, DRIVER_NAME "__master", -1,
NULL, 0, NULL, 0); NULL, 0, NULL, 0);
if (!master) if (IS_ERR(master))
return -EINVAL; return PTR_ERR(master);
platform_set_drvdata(pdev, master); platform_set_drvdata(pdev, master);
return 0; return 0;