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
|