diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2026-07-07 18:56:33 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-07-11 20:38:01 +0200 |
| commit | a3a9c7453fd512e1700d63563fcd316b7795148d (patch) | |
| tree | 8b5742b63bc8951a1fafc38ff915c543b9fa869b /samples | |
| parent | 418a74d106ef4fe08fe9eb239e8b9717b3d79ca4 (diff) | |
samples/kobject: Switch to the new __KOBJ_ATTR() macro
To demonstrate and test the upcoming 'const struct kobj_attribute'
handling, convert the sample to the new macro.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20260707-sysfs-const-attr-kobj-attr-prep-v2-2-35ae1bc0f9ef@weissschuh.net
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/kobject/kobject-example.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c index 36d87ca0bee2..7404f310dc45 100644 --- a/samples/kobject/kobject-example.c +++ b/samples/kobject/kobject-example.c @@ -45,7 +45,7 @@ static ssize_t foo_store(struct kobject *kobj, struct kobj_attribute *attr, /* Sysfs attributes cannot be world-writable. */ static struct kobj_attribute foo_attribute = - __ATTR(foo, 0664, foo_show, foo_store); + __KOBJ_ATTR(foo, 0664, foo_show, foo_store); /* * More complex function where we determine which variable is being accessed by @@ -80,9 +80,9 @@ static ssize_t b_store(struct kobject *kobj, struct kobj_attribute *attr, } static struct kobj_attribute baz_attribute = - __ATTR(baz, 0664, b_show, b_store); + __KOBJ_ATTR(baz, 0664, b_show, b_store); static struct kobj_attribute bar_attribute = - __ATTR(bar, 0664, b_show, b_store); + __KOBJ_ATTR(bar, 0664, b_show, b_store); /* |
