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 <weiyj.lk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dev_nr = id;
pdev = platform_device_register_simple(driver_name, dev_nr, NULL, 0);
- if (pdev == NULL)
- return -ENODEV;
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
*(vhci_pdevs + id) = pdev;
return 0;