My example code attempts from O'Reilly's Linux Device Drivers, 3rd Edition