OSDN Git Service

Merge tag 'driver-core-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[uclinux-h8/linux.git] / drivers / base / platform.c
index 445cbd8..be6c1eb 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) {