Register char device by given MAJOR number

and do cleanup while error happend

Signed-off-by: Keven Liu <airk908@gmail.com>