Call gpio_to_irq() earlier to avoid stopping kthread in error case