These changes are a raw update to a vanilla kernel 4.1.10, with the
[kvmfornfv.git] / kernel / drivers / base / platform.c
index ebf034b..7403de9 100644 (file)
@@ -375,9 +375,7 @@ int platform_device_add(struct platform_device *pdev)
 
        while (--i >= 0) {
                struct resource *r = &pdev->resource[i];
-               unsigned long type = resource_type(r);
-
-               if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
+               if (r->parent)
                        release_resource(r);
        }
 
@@ -408,9 +406,7 @@ void platform_device_del(struct platform_device *pdev)
 
                for (i = 0; i < pdev->num_resources; i++) {
                        struct resource *r = &pdev->resource[i];
-                       unsigned long type = resource_type(r);
-
-                       if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
+                       if (r->parent)
                                release_resource(r);
                }
        }