Bugfix - do not use dev until after we have checked it has been successfully allocated.  Thanks to ljalves for spotting.  Also remove initialisation assignment as kzalloc zeros the memory
Remove IN/OUT macros