mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +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
|
@ -511,7 +511,7 @@ struct module_param_attrs
|
|||
#define to_param_attr(n) container_of(n, struct param_attribute, mattr)
|
||||
|
||||
static ssize_t param_attr_show(struct module_attribute *mattr,
|
||||
struct module *mod, char *buf)
|
||||
struct module_kobject *mk, char *buf)
|
||||
{
|
||||
int count;
|
||||
struct param_attribute *attribute = to_param_attr(mattr);
|
||||
|
@ -531,7 +531,7 @@ static ssize_t param_attr_show(struct module_attribute *mattr,
|
|||
|
||||
/* sysfs always hands a nul-terminated string in buf. We rely on that. */
|
||||
static ssize_t param_attr_store(struct module_attribute *mattr,
|
||||
struct module *owner,
|
||||
struct module_kobject *km,
|
||||
const char *buf, size_t len)
|
||||
{
|
||||
int err;
|
||||
|
@ -807,7 +807,7 @@ static void __init param_sysfs_builtin(void)
|
|||
}
|
||||
|
||||
ssize_t __modver_version_show(struct module_attribute *mattr,
|
||||
struct module *mod, char *buf)
|
||||
struct module_kobject *mk, char *buf)
|
||||
{
|
||||
struct module_version_attribute *vattr =
|
||||
container_of(mattr, struct module_version_attribute, mattr);
|
||||
|
@ -852,7 +852,7 @@ static ssize_t module_attr_show(struct kobject *kobj,
|
|||
if (!attribute->show)
|
||||
return -EIO;
|
||||
|
||||
ret = attribute->show(attribute, mk->mod, buf);
|
||||
ret = attribute->show(attribute, mk, buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -871,7 +871,7 @@ static ssize_t module_attr_store(struct kobject *kobj,
|
|||
if (!attribute->store)
|
||||
return -EIO;
|
||||
|
||||
ret = attribute->store(attribute, mk->mod, buf, len);
|
||||
ret = attribute->store(attribute, mk, buf, len);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue