aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-05-07 23:37:51 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-07 23:37:51 -0400
commit02bbc0f09c90cefdb2837605c96a66c5ce4ba2e1 (patch)
tree04ef573cd4de095c500c9fc3477f4278c0b36300 /drivers/base/platform.c
parent7487a2245b8841c77ba9db406cf99a483b9334e9 (diff)
parent5b94f675f57e4ff16c8fda09088d7480a84dcd91 (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c8
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 */
297void platform_device_del(struct platform_device *pdev) 299void 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}
311EXPORT_SYMBOL_GPL(platform_device_del); 313EXPORT_SYMBOL_GPL(platform_device_del);