diff options
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/base.h | 2 | ||||
| -rw-r--r-- | drivers/base/core.c | 8 | ||||
| -rw-r--r-- | drivers/base/dd.c | 17 | ||||
| -rw-r--r-- | drivers/base/node.c | 2 | ||||
| -rw-r--r-- | drivers/base/power/main.c | 3 | ||||
| -rw-r--r-- | drivers/base/sys.c | 7 |
6 files changed, 27 insertions, 12 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 0a5f055dffba..9f50f1b545dc 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
| @@ -88,8 +88,6 @@ extern void driver_detach(struct device_driver *drv); | |||
| 88 | extern int driver_probe_device(struct device_driver *drv, struct device *dev); | 88 | extern int driver_probe_device(struct device_driver *drv, struct device *dev); |
| 89 | 89 | ||
| 90 | extern void sysdev_shutdown(void); | 90 | extern void sysdev_shutdown(void); |
| 91 | extern int sysdev_suspend(pm_message_t state); | ||
| 92 | extern int sysdev_resume(void); | ||
| 93 | 91 | ||
| 94 | extern char *make_class_name(const char *name, struct kobject *kobj); | 92 | extern char *make_class_name(const char *name, struct kobject *kobj); |
| 95 | 93 | ||
diff --git a/drivers/base/core.c b/drivers/base/core.c index 8079afca4972..f3eae630e589 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
| @@ -777,10 +777,16 @@ static void device_remove_class_symlinks(struct device *dev) | |||
| 777 | int dev_set_name(struct device *dev, const char *fmt, ...) | 777 | int dev_set_name(struct device *dev, const char *fmt, ...) |
| 778 | { | 778 | { |
| 779 | va_list vargs; | 779 | va_list vargs; |
| 780 | char *s; | ||
| 780 | 781 | ||
| 781 | va_start(vargs, fmt); | 782 | va_start(vargs, fmt); |
| 782 | vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs); | 783 | vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs); |
| 783 | va_end(vargs); | 784 | va_end(vargs); |
| 785 | |||
| 786 | /* ewww... some of these buggers have / in the name... */ | ||
| 787 | while ((s = strchr(dev->bus_id, '/'))) | ||
| 788 | *s = '!'; | ||
| 789 | |||
| 784 | return 0; | 790 | return 0; |
| 785 | } | 791 | } |
| 786 | EXPORT_SYMBOL_GPL(dev_set_name); | 792 | EXPORT_SYMBOL_GPL(dev_set_name); |
| @@ -1274,7 +1280,7 @@ EXPORT_SYMBOL_GPL(__root_device_register); | |||
| 1274 | 1280 | ||
| 1275 | /** | 1281 | /** |
| 1276 | * root_device_unregister - unregister and free a root device | 1282 | * root_device_unregister - unregister and free a root device |
| 1277 | * @root: device going away. | 1283 | * @dev: device going away |
| 1278 | * | 1284 | * |
| 1279 | * This function unregisters and cleans up a device that was created by | 1285 | * This function unregisters and cleans up a device that was created by |
| 1280 | * root_device_register(). | 1286 | * root_device_register(). |
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 315bed8d5e7f..135231239103 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
| @@ -18,9 +18,11 @@ | |||
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
| 21 | #include <linux/delay.h> | ||
| 21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 22 | #include <linux/kthread.h> | 23 | #include <linux/kthread.h> |
| 23 | #include <linux/wait.h> | 24 | #include <linux/wait.h> |
| 25 | #include <linux/async.h> | ||
| 24 | 26 | ||
| 25 | #include "base.h" | 27 | #include "base.h" |
| 26 | #include "power/power.h" | 28 | #include "power/power.h" |
| @@ -168,6 +170,21 @@ int driver_probe_done(void) | |||
| 168 | } | 170 | } |
| 169 | 171 | ||
| 170 | /** | 172 | /** |
| 173 | * wait_for_device_probe | ||
| 174 | * Wait for device probing to be completed. | ||
| 175 | * | ||
| 176 | * Note: this function polls at 100 msec intervals. | ||
| 177 | */ | ||
| 178 | int wait_for_device_probe(void) | ||
| 179 | { | ||
| 180 | /* wait for the known devices to complete their probing */ | ||
| 181 | while (driver_probe_done() != 0) | ||
| 182 | msleep(100); | ||
| 183 | async_synchronize_full(); | ||
| 184 | return 0; | ||
| 185 | } | ||
| 186 | |||
| 187 | /** | ||
| 171 | * driver_probe_device - attempt to bind device & driver together | 188 | * driver_probe_device - attempt to bind device & driver together |
| 172 | * @drv: driver to bind a device to | 189 | * @drv: driver to bind a device to |
| 173 | * @dev: device to try to bind to the driver | 190 | * @dev: device to try to bind to the driver |
diff --git a/drivers/base/node.c b/drivers/base/node.c index 43fa90b837ee..f8f578a71b25 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
| @@ -303,7 +303,7 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) | |||
| 303 | sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index); | 303 | sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index); |
| 304 | sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; | 304 | sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; |
| 305 | for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { | 305 | for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { |
| 306 | unsigned int nid; | 306 | int nid; |
| 307 | 307 | ||
| 308 | nid = get_nid_for_pfn(pfn); | 308 | nid = get_nid_for_pfn(pfn); |
| 309 | if (nid < 0) | 309 | if (nid < 0) |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 670c9d6c1407..2d14f4ae6c01 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -333,7 +333,6 @@ static void dpm_power_up(pm_message_t state) | |||
| 333 | */ | 333 | */ |
| 334 | void device_power_up(pm_message_t state) | 334 | void device_power_up(pm_message_t state) |
| 335 | { | 335 | { |
| 336 | sysdev_resume(); | ||
| 337 | dpm_power_up(state); | 336 | dpm_power_up(state); |
| 338 | } | 337 | } |
| 339 | EXPORT_SYMBOL_GPL(device_power_up); | 338 | EXPORT_SYMBOL_GPL(device_power_up); |
| @@ -577,8 +576,6 @@ int device_power_down(pm_message_t state) | |||
| 577 | } | 576 | } |
| 578 | dev->power.status = DPM_OFF_IRQ; | 577 | dev->power.status = DPM_OFF_IRQ; |
| 579 | } | 578 | } |
| 580 | if (!error) | ||
| 581 | error = sysdev_suspend(state); | ||
| 582 | if (error) | 579 | if (error) |
| 583 | dpm_power_up(resume_event(state)); | 580 | dpm_power_up(resume_event(state)); |
| 584 | return error; | 581 | return error; |
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index c98c31ec2f75..b428c8c4bc64 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
| @@ -303,7 +303,6 @@ void sysdev_unregister(struct sys_device * sysdev) | |||
| 303 | * is guaranteed by virtue of the fact that child devices are registered | 303 | * is guaranteed by virtue of the fact that child devices are registered |
| 304 | * after their parents. | 304 | * after their parents. |
| 305 | */ | 305 | */ |
| 306 | |||
| 307 | void sysdev_shutdown(void) | 306 | void sysdev_shutdown(void) |
| 308 | { | 307 | { |
| 309 | struct sysdev_class * cls; | 308 | struct sysdev_class * cls; |
| @@ -363,7 +362,6 @@ static void __sysdev_resume(struct sys_device *dev) | |||
| 363 | * This is only called by the device PM core, so we let them handle | 362 | * This is only called by the device PM core, so we let them handle |
| 364 | * all synchronization. | 363 | * all synchronization. |
| 365 | */ | 364 | */ |
| 366 | |||
| 367 | int sysdev_suspend(pm_message_t state) | 365 | int sysdev_suspend(pm_message_t state) |
| 368 | { | 366 | { |
| 369 | struct sysdev_class * cls; | 367 | struct sysdev_class * cls; |
| @@ -432,7 +430,7 @@ aux_driver: | |||
| 432 | } | 430 | } |
| 433 | return ret; | 431 | return ret; |
| 434 | } | 432 | } |
| 435 | 433 | EXPORT_SYMBOL_GPL(sysdev_suspend); | |
| 436 | 434 | ||
| 437 | /** | 435 | /** |
| 438 | * sysdev_resume - Bring system devices back to life. | 436 | * sysdev_resume - Bring system devices back to life. |
| @@ -442,7 +440,6 @@ aux_driver: | |||
| 442 | * | 440 | * |
| 443 | * Note: Interrupts are disabled when called. | 441 | * Note: Interrupts are disabled when called. |
| 444 | */ | 442 | */ |
| 445 | |||
| 446 | int sysdev_resume(void) | 443 | int sysdev_resume(void) |
| 447 | { | 444 | { |
| 448 | struct sysdev_class * cls; | 445 | struct sysdev_class * cls; |
| @@ -463,7 +460,7 @@ int sysdev_resume(void) | |||
| 463 | } | 460 | } |
| 464 | return 0; | 461 | return 0; |
| 465 | } | 462 | } |
| 466 | 463 | EXPORT_SYMBOL_GPL(sysdev_resume); | |
| 467 | 464 | ||
| 468 | int __init system_bus_init(void) | 465 | int __init system_bus_init(void) |
| 469 | { | 466 | { |
