Skip to contentSkip to conversation

-NODEV vs. -ENODEV

DISCUSSION David Daney 2 participants 2 messages May 25, 2004 – May 26, 2004

lore
Share & tools
lore
#0 lore raw

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