Replaced BUG_ON() with return -EINVAL. Fixed the device unit test. Added notes and a file read unit test.