kset-example.c (4f2c0a4acffbec01079c28f839422e64ddeff004) | kset-example.c (862f6a84d1bf01435fdd6aa8b2811c88ab1f06f4) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Sample kset and ktype implementation 4 * 5 * Copyright (C) 2004-2007 Greg Kroah-Hartman <greg@kroah.com> 6 * Copyright (C) 2007 Novell Inc. 7 */ 8#include <linux/kobject.h> --- 171 unchanged lines hidden (view full) --- 180}; 181ATTRIBUTE_GROUPS(foo_default); 182 183/* 184 * Our own ktype for our kobjects. Here we specify our sysfs ops, the 185 * release function, and the set of default attributes we want created 186 * whenever a kobject of this type is registered with the kernel. 187 */ | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Sample kset and ktype implementation 4 * 5 * Copyright (C) 2004-2007 Greg Kroah-Hartman <greg@kroah.com> 6 * Copyright (C) 2007 Novell Inc. 7 */ 8#include <linux/kobject.h> --- 171 unchanged lines hidden (view full) --- 180}; 181ATTRIBUTE_GROUPS(foo_default); 182 183/* 184 * Our own ktype for our kobjects. Here we specify our sysfs ops, the 185 * release function, and the set of default attributes we want created 186 * whenever a kobject of this type is registered with the kernel. 187 */ |
188static struct kobj_type foo_ktype = { | 188static const struct kobj_type foo_ktype = { |
189 .sysfs_ops = &foo_sysfs_ops, 190 .release = foo_release, 191 .default_groups = foo_default_groups, 192}; 193 194static struct kset *example_kset; 195static struct foo_obj *foo_obj; 196static struct foo_obj *bar_obj; --- 92 unchanged lines hidden --- | 189 .sysfs_ops = &foo_sysfs_ops, 190 .release = foo_release, 191 .default_groups = foo_default_groups, 192}; 193 194static struct kset *example_kset; 195static struct foo_obj *foo_obj; 196static struct foo_obj *bar_obj; --- 92 unchanged lines hidden --- |