Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (i = 0; i < NUMBER_OF_GPIOS; i++)
- {
- error_code
- = request_irq(gpio_to_irq(gpio_list[i].gpio), irq_handlers[i],
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, gpio_list[i].label, NULL);
- if (error_code)
- {
- pr_err("Could not get the requested IRQ for %s\n", DEVICE_NAME);
- gpio_free_array(gpio_list, i);
- // Need to free the irqs already asked for
- for (y = i; y > 0; y--)
- free_irq(gpio_list[y].gpio, NULL);
- device_destroy(cl, devt);
- unregister_chrdev_region(devt, NB_PERIPHERALS);
- class_destroy(cl);
- return error_code;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment