diff options
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 30480f6f2af2..17b5ece8f82c 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -292,20 +292,22 @@ EXPORT_SYMBOL_GPL(platform_device_add); | |||
292 | * @pdev: platform device we're removing | 292 | * @pdev: platform device we're removing |
293 | * | 293 | * |
294 | * Note that this function will also release all memory- and port-based | 294 | * Note that this function will also release all memory- and port-based |
295 | * resources owned by the device (@dev->resource). | 295 | * resources owned by the device (@dev->resource). This function |
296 | * must _only_ be externally called in error cases. All other usage | ||
297 | * is a bug. | ||
296 | */ | 298 | */ |
297 | void platform_device_del(struct platform_device *pdev) | 299 | void platform_device_del(struct platform_device *pdev) |
298 | { | 300 | { |
299 | int i; | 301 | int i; |
300 | 302 | ||
301 | if (pdev) { | 303 | if (pdev) { |
304 | device_del(&pdev->dev); | ||
305 | |||
302 | for (i = 0; i < pdev->num_resources; i++) { | 306 | for (i = 0; i < pdev->num_resources; i++) { |
303 | struct resource *r = &pdev->resource[i]; | 307 | struct resource *r = &pdev->resource[i]; |
304 | if (r->flags & (IORESOURCE_MEM|IORESOURCE_IO)) | 308 | if (r->flags & (IORESOURCE_MEM|IORESOURCE_IO)) |
305 | release_resource(r); | 309 | release_resource(r); |
306 | } | 310 | } |
307 | |||
308 | device_del(&pdev->dev); | ||
309 | } | 311 | } |
310 | } | 312 | } |
311 | EXPORT_SYMBOL_GPL(platform_device_del); | 313 | EXPORT_SYMBOL_GPL(platform_device_del); |