mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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)
This commit is contained in:
parent
66574cc054
commit
4befb026cf
3 changed files with 24 additions and 23 deletions
|
@ -48,10 +48,18 @@ struct modversion_info
|
|||
|
||||
struct module;
|
||||
|
||||
struct module_kobject {
|
||||
struct kobject kobj;
|
||||
struct module *mod;
|
||||
struct kobject *drivers_dir;
|
||||
struct module_param_attrs *mp;
|
||||
};
|
||||
|
||||
struct module_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct module_attribute *, struct module *, char *);
|
||||
ssize_t (*store)(struct module_attribute *, struct module *,
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct module_attribute *, struct module_kobject *,
|
||||
char *);
|
||||
ssize_t (*store)(struct module_attribute *, struct module_kobject *,
|
||||
const char *, size_t count);
|
||||
void (*setup)(struct module *, const char *);
|
||||
int (*test)(struct module *);
|
||||
|
@ -65,15 +73,8 @@ struct module_version_attribute {
|
|||
} __attribute__ ((__aligned__(sizeof(void *))));
|
||||
|
||||
extern ssize_t __modver_version_show(struct module_attribute *,
|
||||
struct module *, char *);
|
||||
struct module_kobject *, char *);
|
||||
|
||||
struct module_kobject
|
||||
{
|
||||
struct kobject kobj;
|
||||
struct module *mod;
|
||||
struct kobject *drivers_dir;
|
||||
struct module_param_attrs *mp;
|
||||
};
|
||||
|
||||
/* These are either module local, or the kernel's dummy ones. */
|
||||
extern int init_module(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue