函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:kernel\irq\generic-chip.c Create Date:2022-07-27 11:13:14
首页 Copyright©Brick

503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
/**
 * irq_setup_alt_chip - Switch to alternative chip
 * @d:      irq_data for this interrupt
 * @type:   Flow type to be initialized
 *
 * Only to be called from chip->irq_set_type() callbacks.
 */
int irq_setup_alt_chip(struct irq_data *d, unsigned int type)
{
    struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
    struct irq_chip_type *ct = gc->chip_types;
    unsigned int i;
 
    for (i = 0; i < gc->num_ct; i++, ct++) {
        if (ct->type & type) {
            d->chip = &ct->chip;
            irq_data_to_desc(d)->handle_irq = ct->handler;
            return 0;
        }
    }
    return -EINVAL;
}