Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177610742
D21564.1794834787.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D21564.1794834787.diff
View Options
Index: sys/compat/linuxkpi/common/include/linux/device.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/device.h
+++ sys/compat/linuxkpi/common/include/linux/device.h
@@ -57,6 +57,7 @@
void (*class_release)(struct class *class);
void (*dev_release)(struct device *dev);
char * (*devnode)(struct device *dev, umode_t *mode);
+ const struct attribute_group **dev_groups;
};
struct dev_pm_ops {
@@ -424,6 +425,9 @@
kobject_init(&dev->kobj, &linux_dev_ktype);
kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev));
+ if (dev->class->dev_groups)
+ return (sysfs_create_groups(&dev->kobj, dev->class->dev_groups));
+
return (0);
}
Index: sys/compat/linuxkpi/common/include/linux/sysfs.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/sysfs.h
+++ sys/compat/linuxkpi/common/include/linux/sysfs.h
@@ -60,11 +60,13 @@
#define __ATTR_NULL { .attr = { .name = NULL } }
+/* NOTE: FreeBSD sysctl code requires .name on the group to be set */
#define ATTRIBUTE_GROUPS(_name) \
static struct attribute_group _name##_group = { \
+ .name = __stringify(_name), \
.attrs = _name##_attrs, \
}; \
- static struct attribute_group *_name##_groups[] = { \
+ static const struct attribute_group *_name##_groups[] = { \
&_name##_group, \
NULL, \
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 1:13 PM (4 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41779232
Default Alt Text
D21564.1794834787.diff (1 KB)
Attached To
Mode
D21564: LinuxKPI: enable class dev_groups attributes
Attached
Detach File
Event Timeline