/* set_irq_chip - set the irq chip for an irq @irq: irq number @chip: pointer to irq chip description structure  */
int set_irq_chip(unsigned int irq, struct irq_chip *chip)
/* set_irq_chip - set the irq chip for an irq @irq: irq number @chip: pointer to irq chip description structure  */
int set_irq_chip(unsigned int irq, struct irq_chip *chip)
{
	struct irq_desc *desc = irq_to_desc(irq);
	unsigned long flags;
	if (!desc) {
		WARN(1, KERN_ERR "Trying to install chip for IRQ%d\n", irq);
		return -EINVAL;
	}
	if (!chip)
		chip = &no_irq_chip;
	raw_spin_lock_irqsave(&desc->lock, flags);
	irq_chip_set_defaults(chip);
	desc->chip = chip;
	raw_spin_unlock_irqrestore(&desc->lock, flags);
	return 0;
}