Introduce a function for looking up the driver major number.
This patch does not change any functionality but makes the source
code easier to read and also makes it easier for Coverity to
analyze this code.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>