I'm trying to add devfs support to my driver, and wonder what is the
suggested method of determining if the kernel the driver is loaded into is
running devfs.
I could just use CONFIG_DEVFS_FS, but this only indicates if the kernel that
the module was compiled against was running devfs, and isn't safe against a
kernel rebuild.
>From the code, I could call either 'devfs_generate_path' or
'devfs_set_file_size' with a NULL handle, which will return ENOSYS from the
stub code and EINVAL from the real devfs code, but feel that this is a
kludge.
Also, what is the recommended replacement for checking the major and minor
device numbers in a call to open - is it to use
'devfs_get_handle_from_inode', and compare with the handle returned from
'devfs_register'?
Thanks in advance
Michael Firth
|