In case of error, the function platform_device_register_data() 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 <weiyongjun1@huawei.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
                                                PLATFORM_DEVID_AUTO,
                                                &pdata,
                                                sizeof(pdata));
-               if (!vimc->subdevs[i]) {
+               if (IS_ERR(vimc->subdevs[i])) {
+                       match = ERR_CAST(vimc->subdevs[i]);
                        while (--i >= 0)
                                platform_device_unregister(vimc->subdevs[i]);
 
-                       return ERR_PTR(-ENOMEM);
+                       return match;
                }
 
                component_match_add(&vimc->pdev.dev, &match, vimc_comp_compare,