For expository purposes, this book presents fragments of driver code without error checking and without all of the special case checks that are necessary in a working driver. I'm following the precept that it's better to explain complicated subjects in a step-by-step manner without inundating you with too much detail too soon. I promise not to lie to you, but I won't always be telling the whole, ugly truth either.
The sample drivers on the companion disc, on the other hand, do have all of the error checking and other stuff that production drivers need. Please refer to the disc, therefore, before incorporating something in your own code.