[PATCH] SA9730 cleanup or fix

From: Panagiotis Issaris
Date: Mon Feb 28 2005 - 09:25:00 EST


Hi,

In the SAA9730 driver the lan_saa9730_start() function always returns
zero which makes the if/return code unnecessary.

The first patch removes this check.

In case it is suspected that the lan_saa9730_start() function might be
modified in the future, causing it to be possible to return values other
then zero, then the second patch -replacing the previous one- fixes the
problem that in that case the requested irq is not being freed.

Both patches apply to 2.6.11-rc5-bk2.

With friendly regards,
Takis
--
OpenPGP key: http://lumumba.luc.ac.be/takis/takis_public_key.txt
fingerprint: 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
diff -uprN linux-2.6.11-rc5-bk2/drivers/net/saa9730.c linux-2.6.11-rc5-bk2-pi/drivers/net/saa9730.c
--- linux-2.6.11-rc5-bk2/drivers/net/saa9730.c 2005-02-28 13:44:53.000000000 +0100
+++ linux-2.6.11-rc5-bk2-pi/drivers/net/saa9730.c 2005-02-28 13:45:23.000000000 +0100
@@ -815,9 +815,8 @@ static int lan_saa9730_open(struct net_d
evm_saa9730_enable_lan_int(lp);

/* Start the LAN controller */
- if (lan_saa9730_start(lp))
- return -1;
-
+ lan_saa9730_start(lp);
+
netif_start_queue(dev);

return 0;
diff -uprN linux-2.6.11-rc5-bk2/drivers/net/saa9730.c linux-2.6.11-rc5-bk2-pi/drivers/net/saa9730.c
--- linux-2.6.11-rc5-bk2/drivers/net/saa9730.c 2005-02-28 13:44:53.000000000 +0100
+++ linux-2.6.11-rc5-bk2-pi/drivers/net/saa9730.c 2005-02-28 14:56:17.000000000 +0100
@@ -816,8 +816,11 @@ static int lan_saa9730_open(struct net_d

/* Start the LAN controller */
if (lan_saa9730_start(lp))
+ {
+ free_irq(dev->irq, (void *) dev);
return -1;
-
+ }
+
netif_start_queue(dev);

return 0;