Merge tag 'driver-core-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / drivers / base / platform.c
index 445cbd8266ca4dc190cb9b2f5081b94d528eb917..be6c1eb3cbe2042718dcf7a8649056f4d12f2e03 100644 (file)
@@ -234,7 +234,7 @@ struct platform_object {
  */
 void platform_device_put(struct platform_device *pdev)
 {
-       if (pdev)
+       if (!IS_ERR_OR_NULL(pdev))
                put_device(&pdev->dev);
 }
 EXPORT_SYMBOL_GPL(platform_device_put);
@@ -447,7 +447,7 @@ void platform_device_del(struct platform_device *pdev)
 {
        int i;
 
-       if (pdev) {
+       if (!IS_ERR_OR_NULL(pdev)) {
                device_del(&pdev->dev);
 
                if (pdev->id_auto) {