Reorder functions to match the linux driver.