diff options
| author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-01-12 11:53:55 -0500 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-01-12 11:53:55 -0500 |
| commit | d3b7737f2b70ed2fb7cef985e70d04fb5dee7b7c (patch) | |
| tree | 190e42f90d152ebad1c077809422c366cdf0577b /kernel | |
| parent | dc6821e0cfe74802aefd2067b40fcdc03fc4599e (diff) | |
| parent | 070680218379e15c1901f4bf21b98e3cbf12b527 (diff) | |
Merge commit '070680218379e15c1901f4bf21b98e3cbf12b527' into stable/for-linus-fixes-3.3
* commit '070680218379e15c1901f4bf21b98e3cbf12b527': (50 commits)
xen-balloon: convert sysdev_class to a regular subsystem
clocksource: convert sysdev_class to a regular subsystem
ibm_rtl: convert sysdev_class to a regular subsystem
edac: convert sysdev_class to a regular subsystem
rtmutex-tester: convert sysdev_class to a regular subsystem
driver-core: implement 'sysdev' functionality for regular devices and buses
kref: fix up the kfree build problems
kref: Remove the memory barriers
kref: Implement kref_put in terms of kref_sub
kref: Inline all functions
Drivers: hv: Get rid of an unnecessary check in hv.c
Drivers: hv: Make the vmbus driver unloadable
Drivers: hv: Fix a memory leak
Documentation: Update stable address
MAINTAINERS: stable: Update address
w1: add fast search for single slave bus
driver-core: skip uevent generation when nobody is listening
drivers: hv: Don't OOPS when you cannot init vmbus
firmware: google: fix gsmi.c build warning
drivers_base: make argument to platform_device_register_full const
...
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/rtmutex-tester.c | 37 | ||||
| -rw-r--r-- | kernel/time/clocksource.c | 37 |
2 files changed, 38 insertions, 36 deletions
diff --git a/kernel/rtmutex-tester.c b/kernel/rtmutex-tester.c index 3d9f31cd79e7..98ec49475460 100644 --- a/kernel/rtmutex-tester.c +++ b/kernel/rtmutex-tester.c | |||
| @@ -6,11 +6,11 @@ | |||
| 6 | * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> | 6 | * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> |
| 7 | * | 7 | * |
| 8 | */ | 8 | */ |
| 9 | #include <linux/device.h> | ||
| 9 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
| 10 | #include <linux/export.h> | 11 | #include <linux/export.h> |
| 11 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 12 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
| 13 | #include <linux/sysdev.h> | ||
| 14 | #include <linux/timer.h> | 14 | #include <linux/timer.h> |
| 15 | #include <linux/freezer.h> | 15 | #include <linux/freezer.h> |
| 16 | 16 | ||
| @@ -27,7 +27,7 @@ struct test_thread_data { | |||
| 27 | int opdata; | 27 | int opdata; |
| 28 | int mutexes[MAX_RT_TEST_MUTEXES]; | 28 | int mutexes[MAX_RT_TEST_MUTEXES]; |
| 29 | int event; | 29 | int event; |
| 30 | struct sys_device sysdev; | 30 | struct device dev; |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | static struct test_thread_data thread_data[MAX_RT_TEST_THREADS]; | 33 | static struct test_thread_data thread_data[MAX_RT_TEST_THREADS]; |
| @@ -271,7 +271,7 @@ static int test_func(void *data) | |||
| 271 | * | 271 | * |
| 272 | * opcode:data | 272 | * opcode:data |
| 273 | */ | 273 | */ |
| 274 | static ssize_t sysfs_test_command(struct sys_device *dev, struct sysdev_attribute *attr, | 274 | static ssize_t sysfs_test_command(struct device *dev, struct device_attribute *attr, |
| 275 | const char *buf, size_t count) | 275 | const char *buf, size_t count) |
| 276 | { | 276 | { |
| 277 | struct sched_param schedpar; | 277 | struct sched_param schedpar; |
| @@ -279,8 +279,8 @@ static ssize_t sysfs_test_command(struct sys_device *dev, struct sysdev_attribut | |||
| 279 | char cmdbuf[32]; | 279 | char cmdbuf[32]; |
| 280 | int op, dat, tid, ret; | 280 | int op, dat, tid, ret; |
| 281 | 281 | ||
| 282 | td = container_of(dev, struct test_thread_data, sysdev); | 282 | td = container_of(dev, struct test_thread_data, dev); |
| 283 | tid = td->sysdev.id; | 283 | tid = td->dev.id; |
| 284 | 284 | ||
| 285 | /* strings from sysfs write are not 0 terminated! */ | 285 | /* strings from sysfs write are not 0 terminated! */ |
| 286 | if (count >= sizeof(cmdbuf)) | 286 | if (count >= sizeof(cmdbuf)) |
| @@ -334,7 +334,7 @@ static ssize_t sysfs_test_command(struct sys_device *dev, struct sysdev_attribut | |||
| 334 | * @dev: thread to query | 334 | * @dev: thread to query |
| 335 | * @buf: char buffer to be filled with thread status info | 335 | * @buf: char buffer to be filled with thread status info |
| 336 | */ | 336 | */ |
| 337 | static ssize_t sysfs_test_status(struct sys_device *dev, struct sysdev_attribute *attr, | 337 | static ssize_t sysfs_test_status(struct device *dev, struct device_attribute *attr, |
| 338 | char *buf) | 338 | char *buf) |
| 339 | { | 339 | { |
| 340 | struct test_thread_data *td; | 340 | struct test_thread_data *td; |
| @@ -342,8 +342,8 @@ static ssize_t sysfs_test_status(struct sys_device *dev, struct sysdev_attribute | |||
| 342 | char *curr = buf; | 342 | char *curr = buf; |
| 343 | int i; | 343 | int i; |
| 344 | 344 | ||
| 345 | td = container_of(dev, struct test_thread_data, sysdev); | 345 | td = container_of(dev, struct test_thread_data, dev); |
| 346 | tsk = threads[td->sysdev.id]; | 346 | tsk = threads[td->dev.id]; |
| 347 | 347 | ||
| 348 | spin_lock(&rttest_lock); | 348 | spin_lock(&rttest_lock); |
| 349 | 349 | ||
| @@ -360,28 +360,29 @@ static ssize_t sysfs_test_status(struct sys_device *dev, struct sysdev_attribute | |||
| 360 | spin_unlock(&rttest_lock); | 360 | spin_unlock(&rttest_lock); |
| 361 | 361 | ||
| 362 | curr += sprintf(curr, ", T: %p, R: %p\n", tsk, | 362 | curr += sprintf(curr, ", T: %p, R: %p\n", tsk, |
| 363 | mutexes[td->sysdev.id].owner); | 363 | mutexes[td->dev.id].owner); |
| 364 | 364 | ||
| 365 | return curr - buf; | 365 | return curr - buf; |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | static SYSDEV_ATTR(status, 0600, sysfs_test_status, NULL); | 368 | static DEVICE_ATTR(status, 0600, sysfs_test_status, NULL); |
| 369 | static SYSDEV_ATTR(command, 0600, NULL, sysfs_test_command); | 369 | static DEVICE_ATTR(command, 0600, NULL, sysfs_test_command); |
| 370 | 370 | ||
| 371 | static struct sysdev_class rttest_sysclass = { | 371 | static struct bus_type rttest_subsys = { |
| 372 | .name = "rttest", | 372 | .name = "rttest", |
| 373 | .dev_name = "rttest", | ||
| 373 | }; | 374 | }; |
| 374 | 375 | ||
| 375 | static int init_test_thread(int id) | 376 | static int init_test_thread(int id) |
| 376 | { | 377 | { |
| 377 | thread_data[id].sysdev.cls = &rttest_sysclass; | 378 | thread_data[id].dev.bus = &rttest_subsys; |
| 378 | thread_data[id].sysdev.id = id; | 379 | thread_data[id].dev.id = id; |
| 379 | 380 | ||
| 380 | threads[id] = kthread_run(test_func, &thread_data[id], "rt-test-%d", id); | 381 | threads[id] = kthread_run(test_func, &thread_data[id], "rt-test-%d", id); |
| 381 | if (IS_ERR(threads[id])) | 382 | if (IS_ERR(threads[id])) |
| 382 | return PTR_ERR(threads[id]); | 383 | return PTR_ERR(threads[id]); |
| 383 | 384 | ||
| 384 | return sysdev_register(&thread_data[id].sysdev); | 385 | return device_register(&thread_data[id].dev); |
| 385 | } | 386 | } |
| 386 | 387 | ||
| 387 | static int init_rttest(void) | 388 | static int init_rttest(void) |
| @@ -393,7 +394,7 @@ static int init_rttest(void) | |||
| 393 | for (i = 0; i < MAX_RT_TEST_MUTEXES; i++) | 394 | for (i = 0; i < MAX_RT_TEST_MUTEXES; i++) |
| 394 | rt_mutex_init(&mutexes[i]); | 395 | rt_mutex_init(&mutexes[i]); |
| 395 | 396 | ||
| 396 | ret = sysdev_class_register(&rttest_sysclass); | 397 | ret = subsys_system_register(&rttest_subsys, NULL); |
| 397 | if (ret) | 398 | if (ret) |
| 398 | return ret; | 399 | return ret; |
| 399 | 400 | ||
| @@ -401,10 +402,10 @@ static int init_rttest(void) | |||
| 401 | ret = init_test_thread(i); | 402 | ret = init_test_thread(i); |
| 402 | if (ret) | 403 | if (ret) |
| 403 | break; | 404 | break; |
| 404 | ret = sysdev_create_file(&thread_data[i].sysdev, &attr_status); | 405 | ret = device_create_file(&thread_data[i].dev, &dev_attr_status); |
| 405 | if (ret) | 406 | if (ret) |
| 406 | break; | 407 | break; |
| 407 | ret = sysdev_create_file(&thread_data[i].sysdev, &attr_command); | 408 | ret = device_create_file(&thread_data[i].dev, &dev_attr_command); |
| 408 | if (ret) | 409 | if (ret) |
| 409 | break; | 410 | break; |
| 410 | } | 411 | } |
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index cf52fda2e096..3f5c8512c033 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
| @@ -23,8 +23,8 @@ | |||
| 23 | * o Allow clocksource drivers to be unregistered | 23 | * o Allow clocksource drivers to be unregistered |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include <linux/device.h> | ||
| 26 | #include <linux/clocksource.h> | 27 | #include <linux/clocksource.h> |
| 27 | #include <linux/sysdev.h> | ||
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
| 30 | #include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */ | 30 | #include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */ |
| @@ -754,8 +754,8 @@ EXPORT_SYMBOL(clocksource_unregister); | |||
| 754 | * Provides sysfs interface for listing current clocksource. | 754 | * Provides sysfs interface for listing current clocksource. |
| 755 | */ | 755 | */ |
| 756 | static ssize_t | 756 | static ssize_t |
| 757 | sysfs_show_current_clocksources(struct sys_device *dev, | 757 | sysfs_show_current_clocksources(struct device *dev, |
| 758 | struct sysdev_attribute *attr, char *buf) | 758 | struct device_attribute *attr, char *buf) |
| 759 | { | 759 | { |
| 760 | ssize_t count = 0; | 760 | ssize_t count = 0; |
| 761 | 761 | ||
| @@ -775,8 +775,8 @@ sysfs_show_current_clocksources(struct sys_device *dev, | |||
| 775 | * Takes input from sysfs interface for manually overriding the default | 775 | * Takes input from sysfs interface for manually overriding the default |
| 776 | * clocksource selection. | 776 | * clocksource selection. |
| 777 | */ | 777 | */ |
| 778 | static ssize_t sysfs_override_clocksource(struct sys_device *dev, | 778 | static ssize_t sysfs_override_clocksource(struct device *dev, |
| 779 | struct sysdev_attribute *attr, | 779 | struct device_attribute *attr, |
| 780 | const char *buf, size_t count) | 780 | const char *buf, size_t count) |
| 781 | { | 781 | { |
| 782 | size_t ret = count; | 782 | size_t ret = count; |
| @@ -809,8 +809,8 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev, | |||
| 809 | * Provides sysfs interface for listing registered clocksources | 809 | * Provides sysfs interface for listing registered clocksources |
| 810 | */ | 810 | */ |
| 811 | static ssize_t | 811 | static ssize_t |
| 812 | sysfs_show_available_clocksources(struct sys_device *dev, | 812 | sysfs_show_available_clocksources(struct device *dev, |
| 813 | struct sysdev_attribute *attr, | 813 | struct device_attribute *attr, |
| 814 | char *buf) | 814 | char *buf) |
| 815 | { | 815 | { |
| 816 | struct clocksource *src; | 816 | struct clocksource *src; |
| @@ -839,35 +839,36 @@ sysfs_show_available_clocksources(struct sys_device *dev, | |||
| 839 | /* | 839 | /* |
| 840 | * Sysfs setup bits: | 840 | * Sysfs setup bits: |
| 841 | */ | 841 | */ |
| 842 | static SYSDEV_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources, | 842 | static DEVICE_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources, |
| 843 | sysfs_override_clocksource); | 843 | sysfs_override_clocksource); |
| 844 | 844 | ||
| 845 | static SYSDEV_ATTR(available_clocksource, 0444, | 845 | static DEVICE_ATTR(available_clocksource, 0444, |
| 846 | sysfs_show_available_clocksources, NULL); | 846 | sysfs_show_available_clocksources, NULL); |
| 847 | 847 | ||
| 848 | static struct sysdev_class clocksource_sysclass = { | 848 | static struct bus_type clocksource_subsys = { |
| 849 | .name = "clocksource", | 849 | .name = "clocksource", |
| 850 | .dev_name = "clocksource", | ||
| 850 | }; | 851 | }; |
| 851 | 852 | ||
| 852 | static struct sys_device device_clocksource = { | 853 | static struct device device_clocksource = { |
| 853 | .id = 0, | 854 | .id = 0, |
| 854 | .cls = &clocksource_sysclass, | 855 | .bus = &clocksource_subsys, |
| 855 | }; | 856 | }; |
| 856 | 857 | ||
| 857 | static int __init init_clocksource_sysfs(void) | 858 | static int __init init_clocksource_sysfs(void) |
| 858 | { | 859 | { |
| 859 | int error = sysdev_class_register(&clocksource_sysclass); | 860 | int error = subsys_system_register(&clocksource_subsys, NULL); |
| 860 | 861 | ||
| 861 | if (!error) | 862 | if (!error) |
| 862 | error = sysdev_register(&device_clocksource); | 863 | error = device_register(&device_clocksource); |
| 863 | if (!error) | 864 | if (!error) |
| 864 | error = sysdev_create_file( | 865 | error = device_create_file( |
| 865 | &device_clocksource, | 866 | &device_clocksource, |
| 866 | &attr_current_clocksource); | 867 | &dev_attr_current_clocksource); |
| 867 | if (!error) | 868 | if (!error) |
| 868 | error = sysdev_create_file( | 869 | error = device_create_file( |
| 869 | &device_clocksource, | 870 | &device_clocksource, |
| 870 | &attr_available_clocksource); | 871 | &dev_attr_available_clocksource); |
| 871 | return error; | 872 | return error; |
| 872 | } | 873 | } |
| 873 | 874 | ||
