慢慢欣赏linux 设备驱动模型sysfs

sysfs_lookup
    dentry->d_op = &sysfs_dentry_ops;
    dentry->d_fsdata = sysfs_get(sd);
    
static int sysfs_open_file(struct inode *inode, struct file *file)
    struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
    struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;

https://www.ibm.com/developerworks/cn/linux/l-cn-sysfs

猜你喜欢

转载自blog.csdn.net/shipinsky/article/details/83570219