diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-08 13:17:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-08 13:17:20 -0500 |
commit | e10154189f001b6428a83f58b03a27954f0f8022 (patch) | |
tree | 30b4ac5760c5d310e9cc2cbf8fc4b9c6f9d0e369 /kernel | |
parent | d4bab1b091be4a91a7363118c9ede3cc9a7fefd4 (diff) | |
parent | 410c17651998944630a95fbb286a50362de2dbb0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (62 commits)
msi-laptop: depends on RFKILL
msi-laptop: Detect 3G device exists by standard ec command
msi-laptop: Add resume method for set the SCM load again
msi-laptop: Support some MSI 3G netbook that is need load SCM
msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
Driver core: create lock/unlock functions for struct device
sysfs: fix for thinko with sysfs_bin_attr_init()
sysfs: Kill unused sysfs_sb variable.
sysfs: Pass super_block to sysfs_get_inode
driver core: Use sysfs_rename_link in device_rename
sysfs: Implement sysfs_rename_link
sysfs: Pack sysfs_dirent more tightly.
sysfs: Serialize updates to the vfs inode
sysfs: windfarm: init sysfs attributes
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
sysfs: Document sysfs_attr_init and sysfs_bin_attr_init
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
sysfs: Use one lockdep class per sysfs attribute.
sysfs: Only take active references on attributes.
...
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 3 | ||||
-rw-r--r-- | kernel/params.c | 5 | ||||
-rw-r--r-- | kernel/perf_event.c | 13 | ||||
-rw-r--r-- | kernel/sched.c | 4 |
4 files changed, 20 insertions, 5 deletions
diff --git a/kernel/module.c b/kernel/module.c index e5538d5f00ad..c968d3606dca 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1085,6 +1085,7 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, | |||
1085 | if (sattr->name == NULL) | 1085 | if (sattr->name == NULL) |
1086 | goto out; | 1086 | goto out; |
1087 | sect_attrs->nsections++; | 1087 | sect_attrs->nsections++; |
1088 | sysfs_attr_init(&sattr->mattr.attr); | ||
1088 | sattr->mattr.show = module_sect_show; | 1089 | sattr->mattr.show = module_sect_show; |
1089 | sattr->mattr.store = NULL; | 1090 | sattr->mattr.store = NULL; |
1090 | sattr->mattr.attr.name = sattr->name; | 1091 | sattr->mattr.attr.name = sattr->name; |
@@ -1180,6 +1181,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect, | |||
1180 | if (sect_empty(&sechdrs[i])) | 1181 | if (sect_empty(&sechdrs[i])) |
1181 | continue; | 1182 | continue; |
1182 | if (sechdrs[i].sh_type == SHT_NOTE) { | 1183 | if (sechdrs[i].sh_type == SHT_NOTE) { |
1184 | sysfs_bin_attr_init(nattr); | ||
1183 | nattr->attr.name = mod->sect_attrs->attrs[loaded].name; | 1185 | nattr->attr.name = mod->sect_attrs->attrs[loaded].name; |
1184 | nattr->attr.mode = S_IRUGO; | 1186 | nattr->attr.mode = S_IRUGO; |
1185 | nattr->size = sechdrs[i].sh_size; | 1187 | nattr->size = sechdrs[i].sh_size; |
@@ -1252,6 +1254,7 @@ int module_add_modinfo_attrs(struct module *mod) | |||
1252 | if (!attr->test || | 1254 | if (!attr->test || |
1253 | (attr->test && attr->test(mod))) { | 1255 | (attr->test && attr->test(mod))) { |
1254 | memcpy(temp_attr, attr, sizeof(*temp_attr)); | 1256 | memcpy(temp_attr, attr, sizeof(*temp_attr)); |
1257 | sysfs_attr_init(&temp_attr->attr); | ||
1255 | error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr); | 1258 | error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr); |
1256 | ++temp_attr; | 1259 | ++temp_attr; |
1257 | } | 1260 | } |
diff --git a/kernel/params.c b/kernel/params.c index 8d95f5451b22..d55a53ec9234 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -516,6 +516,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk, | |||
516 | new->grp.attrs = attrs; | 516 | new->grp.attrs = attrs; |
517 | 517 | ||
518 | /* Tack new one on the end. */ | 518 | /* Tack new one on the end. */ |
519 | sysfs_attr_init(&new->attrs[num].mattr.attr); | ||
519 | new->attrs[num].param = kp; | 520 | new->attrs[num].param = kp; |
520 | new->attrs[num].mattr.show = param_attr_show; | 521 | new->attrs[num].mattr.show = param_attr_show; |
521 | new->attrs[num].mattr.store = param_attr_store; | 522 | new->attrs[num].mattr.store = param_attr_store; |
@@ -722,7 +723,7 @@ static ssize_t module_attr_store(struct kobject *kobj, | |||
722 | return ret; | 723 | return ret; |
723 | } | 724 | } |
724 | 725 | ||
725 | static struct sysfs_ops module_sysfs_ops = { | 726 | static const struct sysfs_ops module_sysfs_ops = { |
726 | .show = module_attr_show, | 727 | .show = module_attr_show, |
727 | .store = module_attr_store, | 728 | .store = module_attr_store, |
728 | }; | 729 | }; |
@@ -736,7 +737,7 @@ static int uevent_filter(struct kset *kset, struct kobject *kobj) | |||
736 | return 0; | 737 | return 0; |
737 | } | 738 | } |
738 | 739 | ||
739 | static struct kset_uevent_ops module_uevent_ops = { | 740 | static const struct kset_uevent_ops module_uevent_ops = { |
740 | .filter = uevent_filter, | 741 | .filter = uevent_filter, |
741 | }; | 742 | }; |
742 | 743 | ||
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 8e352c756ba7..f40560b86544 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -5481,13 +5481,16 @@ void __init perf_event_init(void) | |||
5481 | register_cpu_notifier(&perf_cpu_nb); | 5481 | register_cpu_notifier(&perf_cpu_nb); |
5482 | } | 5482 | } |
5483 | 5483 | ||
5484 | static ssize_t perf_show_reserve_percpu(struct sysdev_class *class, char *buf) | 5484 | static ssize_t perf_show_reserve_percpu(struct sysdev_class *class, |
5485 | struct sysdev_class_attribute *attr, | ||
5486 | char *buf) | ||
5485 | { | 5487 | { |
5486 | return sprintf(buf, "%d\n", perf_reserved_percpu); | 5488 | return sprintf(buf, "%d\n", perf_reserved_percpu); |
5487 | } | 5489 | } |
5488 | 5490 | ||
5489 | static ssize_t | 5491 | static ssize_t |
5490 | perf_set_reserve_percpu(struct sysdev_class *class, | 5492 | perf_set_reserve_percpu(struct sysdev_class *class, |
5493 | struct sysdev_class_attribute *attr, | ||
5491 | const char *buf, | 5494 | const char *buf, |
5492 | size_t count) | 5495 | size_t count) |
5493 | { | 5496 | { |
@@ -5516,13 +5519,17 @@ perf_set_reserve_percpu(struct sysdev_class *class, | |||
5516 | return count; | 5519 | return count; |
5517 | } | 5520 | } |
5518 | 5521 | ||
5519 | static ssize_t perf_show_overcommit(struct sysdev_class *class, char *buf) | 5522 | static ssize_t perf_show_overcommit(struct sysdev_class *class, |
5523 | struct sysdev_class_attribute *attr, | ||
5524 | char *buf) | ||
5520 | { | 5525 | { |
5521 | return sprintf(buf, "%d\n", perf_overcommit); | 5526 | return sprintf(buf, "%d\n", perf_overcommit); |
5522 | } | 5527 | } |
5523 | 5528 | ||
5524 | static ssize_t | 5529 | static ssize_t |
5525 | perf_set_overcommit(struct sysdev_class *class, const char *buf, size_t count) | 5530 | perf_set_overcommit(struct sysdev_class *class, |
5531 | struct sysdev_class_attribute *attr, | ||
5532 | const char *buf, size_t count) | ||
5526 | { | 5533 | { |
5527 | unsigned long val; | 5534 | unsigned long val; |
5528 | int err; | 5535 | int err; |
diff --git a/kernel/sched.c b/kernel/sched.c index b47ceeec1a91..150b6988de49 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -7406,11 +7406,13 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) | |||
7406 | 7406 | ||
7407 | #ifdef CONFIG_SCHED_MC | 7407 | #ifdef CONFIG_SCHED_MC |
7408 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, | 7408 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, |
7409 | struct sysdev_class_attribute *attr, | ||
7409 | char *page) | 7410 | char *page) |
7410 | { | 7411 | { |
7411 | return sprintf(page, "%u\n", sched_mc_power_savings); | 7412 | return sprintf(page, "%u\n", sched_mc_power_savings); |
7412 | } | 7413 | } |
7413 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, | 7414 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, |
7415 | struct sysdev_class_attribute *attr, | ||
7414 | const char *buf, size_t count) | 7416 | const char *buf, size_t count) |
7415 | { | 7417 | { |
7416 | return sched_power_savings_store(buf, count, 0); | 7418 | return sched_power_savings_store(buf, count, 0); |
@@ -7422,11 +7424,13 @@ static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, | |||
7422 | 7424 | ||
7423 | #ifdef CONFIG_SCHED_SMT | 7425 | #ifdef CONFIG_SCHED_SMT |
7424 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, | 7426 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, |
7427 | struct sysdev_class_attribute *attr, | ||
7425 | char *page) | 7428 | char *page) |
7426 | { | 7429 | { |
7427 | return sprintf(page, "%u\n", sched_smt_power_savings); | 7430 | return sprintf(page, "%u\n", sched_smt_power_savings); |
7428 | } | 7431 | } |
7429 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, | 7432 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, |
7433 | struct sysdev_class_attribute *attr, | ||
7430 | const char *buf, size_t count) | 7434 | const char *buf, size_t count) |
7431 | { | 7435 | { |
7432 | return sched_power_savings_store(buf, count, 1); | 7436 | return sched_power_savings_store(buf, count, 1); |