diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-07-24 08:36:04 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-07-24 08:36:04 -0400 |
commit | 4befb026cf74b52fc7d382142bbfc0e9b6aab5e7 (patch) | |
tree | 48c4954f8eb9ab43f449750c3f4b0685fd323c03 /include | |
parent | 66574cc05438dd0907029075d7e6ec5ac0036fbc (diff) |
module: change attr callbacks to take struct module_kobject
This simplifies the next patch, where we have an attribute on a
builtin module (ie. module == NULL).
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (split into 2)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/module.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index d9ca2d5dc6d0..b87e7625a98c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -48,10 +48,18 @@ struct modversion_info | |||
48 | 48 | ||
49 | struct module; | 49 | struct module; |
50 | 50 | ||
51 | struct module_kobject { | ||
52 | struct kobject kobj; | ||
53 | struct module *mod; | ||
54 | struct kobject *drivers_dir; | ||
55 | struct module_param_attrs *mp; | ||
56 | }; | ||
57 | |||
51 | struct module_attribute { | 58 | struct module_attribute { |
52 | struct attribute attr; | 59 | struct attribute attr; |
53 | ssize_t (*show)(struct module_attribute *, struct module *, char *); | 60 | ssize_t (*show)(struct module_attribute *, struct module_kobject *, |
54 | ssize_t (*store)(struct module_attribute *, struct module *, | 61 | char *); |
62 | ssize_t (*store)(struct module_attribute *, struct module_kobject *, | ||
55 | const char *, size_t count); | 63 | const char *, size_t count); |
56 | void (*setup)(struct module *, const char *); | 64 | void (*setup)(struct module *, const char *); |
57 | int (*test)(struct module *); | 65 | int (*test)(struct module *); |
@@ -65,15 +73,8 @@ struct module_version_attribute { | |||
65 | } __attribute__ ((__aligned__(sizeof(void *)))); | 73 | } __attribute__ ((__aligned__(sizeof(void *)))); |
66 | 74 | ||
67 | extern ssize_t __modver_version_show(struct module_attribute *, | 75 | extern ssize_t __modver_version_show(struct module_attribute *, |
68 | struct module *, char *); | 76 | struct module_kobject *, char *); |
69 | 77 | ||
70 | struct module_kobject | ||
71 | { | ||
72 | struct kobject kobj; | ||
73 | struct module *mod; | ||
74 | struct kobject *drivers_dir; | ||
75 | struct module_param_attrs *mp; | ||
76 | }; | ||
77 | 78 | ||
78 | /* These are either module local, or the kernel's dummy ones. */ | 79 | /* These are either module local, or the kernel's dummy ones. */ |
79 | extern int init_module(void); | 80 | extern int init_module(void); |