devfs
[Top] [All Lists]

Re: Determining if devfs is running from a module

To: michael.firth@xxxxxx
Subject: Re: Determining if devfs is running from a module
From: Richard Gooch <rgooch@xxxxxxxxxxxxxxx>
Date: Thu, 8 Aug 2002 10:30:21 -0600
Cc: devfs@xxxxxxxxxxx
In-reply-to: <5104D4DBC598D211B5FE0000F8FE7EB21681EB02@mbtlipnt02.btlabs.bt.co.uk>
References: <5104D4DBC598D211B5FE0000F8FE7EB21681EB02@mbtlipnt02.btlabs.bt.co.uk>
Sender: owner-devfs@xxxxxxxxxxx
michael firth writes:
> 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.

Binary modules are not safe against kernel rebuilds anyway, so just
give up on the idea. Any time the kernel configuration changes, you
*MUST* recompile modules.

So just make your calls into the devfs API. There is no need to wrap
them in #ifdef CONFIG_DEVFS_FS, since the header file takes care of
this.

> 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'?

I don't really understand your question. What is it you're trying to
do?

BTW: does this module require devfs, or does it just support devfs?

                                Regards,

                                        Richard....
Permanent: rgooch@xxxxxxxxxxxxx
Current:   rgooch@xxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>