Uwe Kleine-König 82736f4d1d generic irqs: handle failure of irqchip->set_type in setup_irq
set_type returns an int indicating success or failure, but up to now
setup_irq ignores that.

In my case this resulted in a machine hang:

gpio-keys requested IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, but
arm/ns9xxx can only trigger on one direction so set_type didn't touch
the configuration which happens do default to a level sensitiveness and
returned -EINVAL.  setup_irq ignored that and unmasked the irq.  This
resulted in an endless triggering of the gpio-key interrupt service
routine which effectively killed the machine.

With this patch applied setup_irq propagates the error to the caller.

Note that before in the case

	chip && !chip->set_type && !chip->name

a NULL pointer was feed to printk.  This is fixed, too.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:24 -07:00
..
2008-07-23 17:47:32 -07:00
2008-05-01 08:03:59 -07:00
2008-03-30 14:18:41 -07:00
2007-07-16 09:05:50 -07:00
2008-06-24 10:52:55 -05:00
2008-07-16 23:27:03 +02:00
2008-04-29 08:05:59 -07:00
2008-07-02 15:06:24 -06:00
2008-07-16 18:02:33 -07:00
2007-07-16 09:05:50 -07:00
2008-05-23 20:39:40 +02:00
2008-02-06 10:41:02 -08:00
2008-04-30 08:29:53 -07:00
2008-02-08 09:22:31 -08:00