-NODEV vs. -ENODEV
While working on a driver that is not part of the standard kernel sources, I found that dev_open() was returning -NODEV when there was no device (instead of -ENODEV).
Since NODEV is #defined to be 0 this caused open to erroneously report success.
It seems to me that any place you see -NODEV in the kernel sources is almost certainly an error.
Using the 2.4.25 sources from linux-mips.org I get the following:
$ grep -r -- -NODEV * drivers/isdn/sc/command.c: return -NODEV; drivers/media/video/cpia.c: return -NODEV; drivers/net/defxx.c: int rc = -NODEV;
I have no idea if these still exist in the current sources, but I suspect that they do.
David Daney
Thanks for the report, I'll fix up these 2.4.x cases.