diff options
Diffstat (limited to 'kernel/params.c')
-rw-r--r-- | kernel/params.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/params.c b/kernel/params.c index ed72e133086..22df3e0d142 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -225,8 +225,8 @@ int parse_args(const char *name, | |||
225 | int ret; \ | 225 | int ret; \ |
226 | \ | 226 | \ |
227 | ret = strtolfn(val, 0, &l); \ | 227 | ret = strtolfn(val, 0, &l); \ |
228 | if (ret == -EINVAL || ((type)l != l)) \ | 228 | if (ret < 0 || ((type)l != l)) \ |
229 | return -EINVAL; \ | 229 | return ret < 0 ? ret : -EINVAL; \ |
230 | *((type *)kp->arg) = l; \ | 230 | *((type *)kp->arg) = l; \ |
231 | return 0; \ | 231 | return 0; \ |
232 | } \ | 232 | } \ |
@@ -511,7 +511,7 @@ struct module_param_attrs | |||
511 | #define to_param_attr(n) container_of(n, struct param_attribute, mattr) | 511 | #define to_param_attr(n) container_of(n, struct param_attribute, mattr) |
512 | 512 | ||
513 | static ssize_t param_attr_show(struct module_attribute *mattr, | 513 | static ssize_t param_attr_show(struct module_attribute *mattr, |
514 | struct module *mod, char *buf) | 514 | struct module_kobject *mk, char *buf) |
515 | { | 515 | { |
516 | int count; | 516 | int count; |
517 | struct param_attribute *attribute = to_param_attr(mattr); | 517 | struct param_attribute *attribute = to_param_attr(mattr); |
@@ -531,7 +531,7 @@ static ssize_t param_attr_show(struct module_attribute *mattr, | |||
531 | 531 | ||
532 | /* sysfs always hands a nul-terminated string in buf. We rely on that. */ | 532 | /* sysfs always hands a nul-terminated string in buf. We rely on that. */ |
533 | static ssize_t param_attr_store(struct module_attribute *mattr, | 533 | static ssize_t param_attr_store(struct module_attribute *mattr, |
534 | struct module *owner, | 534 | struct module_kobject *km, |
535 | const char *buf, size_t len) | 535 | const char *buf, size_t len) |
536 | { | 536 | { |
537 | int err; | 537 | int err; |
@@ -730,6 +730,10 @@ static struct module_kobject * __init locate_module_kobject(const char *name) | |||
730 | mk->kobj.kset = module_kset; | 730 | mk->kobj.kset = module_kset; |
731 | err = kobject_init_and_add(&mk->kobj, &module_ktype, NULL, | 731 | err = kobject_init_and_add(&mk->kobj, &module_ktype, NULL, |
732 | "%s", name); | 732 | "%s", name); |
733 | #ifdef CONFIG_MODULES | ||
734 | if (!err) | ||
735 | err = sysfs_create_file(&mk->kobj, &module_uevent.attr); | ||
736 | #endif | ||
733 | if (err) { | 737 | if (err) { |
734 | kobject_put(&mk->kobj); | 738 | kobject_put(&mk->kobj); |
735 | printk(KERN_ERR | 739 | printk(KERN_ERR |
@@ -807,7 +811,7 @@ static void __init param_sysfs_builtin(void) | |||
807 | } | 811 | } |
808 | 812 | ||
809 | ssize_t __modver_version_show(struct module_attribute *mattr, | 813 | ssize_t __modver_version_show(struct module_attribute *mattr, |
810 | struct module *mod, char *buf) | 814 | struct module_kobject *mk, char *buf) |
811 | { | 815 | { |
812 | struct module_version_attribute *vattr = | 816 | struct module_version_attribute *vattr = |
813 | container_of(mattr, struct module_version_attribute, mattr); | 817 | container_of(mattr, struct module_version_attribute, mattr); |
@@ -852,7 +856,7 @@ static ssize_t module_attr_show(struct kobject *kobj, | |||
852 | if (!attribute->show) | 856 | if (!attribute->show) |
853 | return -EIO; | 857 | return -EIO; |
854 | 858 | ||
855 | ret = attribute->show(attribute, mk->mod, buf); | 859 | ret = attribute->show(attribute, mk, buf); |
856 | 860 | ||
857 | return ret; | 861 | return ret; |
858 | } | 862 | } |
@@ -871,7 +875,7 @@ static ssize_t module_attr_store(struct kobject *kobj, | |||
871 | if (!attribute->store) | 875 | if (!attribute->store) |
872 | return -EIO; | 876 | return -EIO; |
873 | 877 | ||
874 | ret = attribute->store(attribute, mk->mod, buf, len); | 878 | ret = attribute->store(attribute, mk, buf, len); |
875 | 879 | ||
876 | return ret; | 880 | return ret; |
877 | } | 881 | } |