-NODEV vs. -ENODEV

From: David Daney
Date: Tue May 25 2004 - 18:58:34 EST


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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/