Creating a proc entry in the parent folder

I want to create a proc entry in the / proc / driver / path directory,

I am using this code:

 struct file *fp = filp_open("/proc/driver",O_RDONLY,0);
 struct proc_dir_entry *parent ;
 parent =  PDE(fp->f_dentry->d_inode);
 filp_close(fp, NULL);
 proc_create("leds",0,parent,&proc_fops);

But when compiling, I got an error:

error: implicit declaration of function ‘PDE’ [-Werror=implicit-function-declaration]

How can I fix this problem? Thanks in advance.

+4
source share
1 answer

Have you included the header file containing the PDE declaration?

+2
source

All Articles