devfs
[Top] [All Lists]

non-DevFS behavior of devfs_register returns NULL; seems backwords

To: devfs <devfs@xxxxxxxxxxx>, jgrimm@xxxxxxxxxx
Subject: non-DevFS behavior of devfs_register returns NULL; seems backwords
From: Jon Grimm <jgrimm@xxxxxxxxxx>
Date: Tue, 23 Jan 2001 18:44:46 -0600
Organization: IBM
Sender: owner-devfs@xxxxxxxxxxx
Hi,
    Working a new driver and am using the devfs_*  APIs right from the
start.    I like the inlined compatibility functions that are provided
when the kernel is not configured to build devfs support, however .....

I noticed that the inlined devfs_register API returns a NULL.
Unfortunately, this return code matches the error condition of
devfs_register.   So my error routines kick in on a non-DevFS build.

Could devfs_register ever fail?   I don't see many examples of checking
the returned handle in other driver source, but I'm try hard to check
advertised failure behavior.   I could put #ifdef CONFIG_DEVFS_FS in my
code, but this would seem to defeat the purpose of the compatibility
macros, as well as, introduce a (minor) future maintenance issue if
CONFIG_DEVFS_FS goes away with DevFS becoming mainstream.

Would there be other side-effects to returning a non-NULL return code.
Is it worth the trouble?

Any opinions?

Regards,
Jon Grimm
jgrimm@xxxxxxxxxx


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