From a3a9c7453fd512e1700d63563fcd316b7795148d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 7 Jul 2026 18:56:33 +0200 Subject: [PATCH] samples/kobject: Switch to the new __KOBJ_ATTR() macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To demonstrate and test the upcoming 'const struct kobj_attribute' handling, convert the sample to the new macro. Signed-off-by: Thomas Weißschuh Link: https://patch.msgid.link/20260707-sysfs-const-attr-kobj-attr-prep-v2-2-35ae1bc0f9ef@weissschuh.net Signed-off-by: Danilo Krummrich --- samples/kobject/kobject-example.c | 6 +++--- 1 file 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); /*