/* Note: we need to scan all the irq's even though we will only return autodetect irq numbers - just so that we reset them all to a known state.  */
unsigned int probe_irq_mask(unsigned long val)
/* Note: we need to scan all the irq's even though we will only return autodetect irq numbers - just so that we reset them all to a known state.  */
unsigned int probe_irq_mask(unsigned long val)
{
	unsigned int status, mask = 0;
	struct irq_desc *desc;
	int i;
	for_each_irq_desc(i, desc) {
		raw_spin_lock_irq(&desc->lock);
		status = desc->status;
		if (status & IRQ_AUTODETECT) {
			if (i < 16 && !(status & IRQ_WAITING))
				mask |= 1 << i;
			desc->status = status & ~IRQ_AUTODETECT;
			desc->chip->shutdown(i);
		}
		raw_spin_unlock_irq(&desc->lock);
	}
	mutex_unlock(&probing_active);
	return mask & val;
}