Mendapatkan kesalahan: deklarasi fungsi implisit 'proc_create'

Saya mendapatkan kesalahan "deklarasi fungsi implisit 'proc_create'" saat mengkompilasi modul driver saya. Saya ingin membuat entri di/proc dan mencetak jumlah program yang menggunakan modul tersebut. Bisakah Anda memberi tahu saya apa yang salah di sini?? Ini kode saya.

#include<linux/module.h>
#include<linux/fs.h>

#define HELLO_MAJOR 234
static int debug_enable = 0;
static int no_of_access;
module_param(debug_enable, int, 0);
MODULE_PARM_DESC(debug_enable, "Enable module debug mode.");
struct file_operations hello_fops;
struct proc_dir_entry *proc_file_entry;

<File operation functions...>
<Incremented global_counter in the file open operation.>

static int hello1_read_proc(char *buf, char **start, off_t offset,
                            int count, int *eof, void *data)
{
    int len=0;
    len += sprintf(buf+len, no_of_access);
    *eof=1;
    return len;

}

static int __init hello_init(void)
{
    int ret;
    proc_file_entry = proc_create("examples/hello1", 0,NULL, hello1_read_proc);
    if(proc_file_entry == NULL)
            return -ENOMEM;
    printk("\nProc file entry for hello1 has been created !!!\n");

}

static void __exit hello_exit(void)
{
    printk("Hello Example Exit\n");
    remove_proc_entry("exmaples/hello1", NULL);
    unregister_chrdev(HELLO_MAJOR,"hello1");
 }

Terima kasih sebelumnya.


person mohan.t    schedule 26.10.2013    source sumber


Jawaban (1)


Anda juga perlu memasukkan <linux/proc_fs.h>

person NG.    schedule 26.10.2013