sunhme: Fix Quattro HME irq registration on proble failures
authorMeelis Roos <mroos@linux.ee>
Wed, 11 Feb 2009 01:29:42 +0000 (17:29 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Feb 2009 01:29:42 +0000 (17:29 -0800)
commit7b7a799d664a46eec6cb7de200c90f40730497a7
tree8d14ebfbfcf4285388736e1b45a5d6dd7e17220b
parentfcffd0d8bbddac757cd856e635ac75e8eb4518bc
sunhme: Fix Quattro HME irq registration on proble failures

Currently, the sunhme driver installs SBus Quattro interrupt handler
when at least one HME card was initialized correctly and at least one
Quattro card is present. This breaks when a Quattro card fails
initialization for whatever reason - IRQ is registered and OOPS happens
when it fires.

The solution, as suggested by David Miller, was to keep track which
cards of the Quattro bundles have been initialized, and request/free the
Quattro IRQ only when all four devices have been successfully
initialized.

The patch only touches SBus initialization - PCI init already resets the
card pointer to NULL on init failure.

The patch has been tested on Sun E3500 with SBus and PCI single HME
cards and one PCI Quattro HME card in a situation where any PCI card
failed init when the SBus routines tried to init them by mistake.

Additionally it replaces Quattro request_irq panic with error return -
if this card fails to work, at least let the others work.

Tested on E450 with PCI HME and PCI Quad HME.

[ Minor coding style fixups -DaveM ]

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sunhme.c