aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 21:04:48 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 21:04:48 -0400
commit5b339915762d30b21995aa7263e74081f2f1110a (patch)
tree4e076dbd27025054b21dddd78a1cb3fef3de34d7 /drivers/base/platform.c
parent89661adaaee2f85116b399e642129ccd4dafd195 (diff)
parent823bccfc4002296ba88c3ad0f049e1abd8108d30 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: remove "struct subsystem" as it is no longer needed sysfs: printk format warning DOC: Fix wrong identifier name in Documentation/driver-model/devres.txt platform: reorder platform_device_del Driver core: fix show_uevent from taking up way too much stack
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);