新增CommonAttrGroup,基本支持sysfs下各种类型设备的uevent属性文件的读测试

This commit is contained in:
val213
2024-10-13 22:22:34 +08:00
parent 4e4ce68e03
commit 178486f1e5
16 changed files with 122 additions and 55 deletions

View File

@ -11,8 +11,8 @@ use crate::{
base::{
class::Class,
device::{
bus::Bus, device_manager, driver::Driver, Device, DeviceCommonData, DeviceType,
IdTable,
bus::Bus, device_manager, driver::Driver, CommonAttrGroup, Device,
DeviceCommonData, DeviceType, IdTable,
},
kobject::{KObjType, KObject, KObjectCommonData, KObjectState, LockedKObjectState},
kset::KSet,
@ -235,7 +235,7 @@ impl Device for FbConsoleDevice {
}
fn attribute_groups(&self) -> Option<&'static [&'static dyn AttributeGroup]> {
return Some(&[&AnonymousAttributeGroup]);
return Some(&[&AnonymousAttributeGroup, &CommonAttrGroup]);
}
fn dev_parent(&self) -> Option<Weak<dyn Device>> {