mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00: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
|
@ -545,9 +545,9 @@ static void setup_modinfo_##field(struct module *mod, const char *s) \
|
|||
mod->field = kstrdup(s, GFP_KERNEL); \
|
||||
} \
|
||||
static ssize_t show_modinfo_##field(struct module_attribute *mattr, \
|
||||
struct module *mod, char *buffer) \
|
||||
struct module_kobject *mk, char *buffer) \
|
||||
{ \
|
||||
return sprintf(buffer, "%s\n", mod->field); \
|
||||
return sprintf(buffer, "%s\n", mk->mod->field); \
|
||||
} \
|
||||
static int modinfo_##field##_exists(struct module *mod) \
|
||||
{ \
|
||||
|
@ -902,9 +902,9 @@ void symbol_put_addr(void *addr)
|
|||
EXPORT_SYMBOL_GPL(symbol_put_addr);
|
||||
|
||||
static ssize_t show_refcnt(struct module_attribute *mattr,
|
||||
struct module *mod, char *buffer)
|
||||
struct module_kobject *mk, char *buffer)
|
||||
{
|
||||
return sprintf(buffer, "%u\n", module_refcount(mod));
|
||||
return sprintf(buffer, "%u\n", module_refcount(mk->mod));
|
||||
}
|
||||
|
||||
static struct module_attribute refcnt = {
|
||||
|
@ -952,11 +952,11 @@ static inline int module_unload_init(struct module *mod)
|
|||
#endif /* CONFIG_MODULE_UNLOAD */
|
||||
|
||||
static ssize_t show_initstate(struct module_attribute *mattr,
|
||||
struct module *mod, char *buffer)
|
||||
struct module_kobject *mk, char *buffer)
|
||||
{
|
||||
const char *state = "unknown";
|
||||
|
||||
switch (mod->state) {
|
||||
switch (mk->mod->state) {
|
||||
case MODULE_STATE_LIVE:
|
||||
state = "live";
|
||||
break;
|
||||
|
@ -1187,7 +1187,7 @@ struct module_sect_attrs
|
|||
};
|
||||
|
||||
static ssize_t module_sect_show(struct module_attribute *mattr,
|
||||
struct module *mod, char *buf)
|
||||
struct module_kobject *mk, char *buf)
|
||||
{
|
||||
struct module_sect_attr *sattr =
|
||||
container_of(mattr, struct module_sect_attr, mattr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue