[linux-dvb] [patch 2.6.12-rc4-dvb-cvs 14/14] dvb: fix the status code returned by dvb_net_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix the status code returned by dvb_net_init

- dvb_register_device can fail;
- remove an open-coded memset while at it.

Signed-off-by: Francois Romieu <romieu@xxxxxxxxxxxxx>

diff -puN drivers/media/dvb/dvb-core/dvb_net.c~dvb-250 drivers/media/dvb/dvb-core/dvb_net.c
--- a/drivers/media/dvb/dvb-core/dvb_net.c~dvb-250	2005-05-20 19:42:25.597614961 +0200
+++ b/drivers/media/dvb/dvb-core/dvb_net.c	2005-05-20 19:42:25.622610879 +0200
@@ -1383,16 +1383,11 @@ EXPORT_SYMBOL(dvb_net_release);
 int dvb_net_init (struct dvb_adapter *adap, struct dvb_net *dvbnet,
 		  struct dmx_demux *dmx)
 {
-	int i;
-
 	dvbnet->demux = dmx;
 
-	for (i=0; i<DVB_NET_DEVICES_MAX; i++)
-		dvbnet->state[i] = 0;
-
-	dvb_register_device (adap, &dvbnet->dvbdev, &dvbdev_net,
-			     dvbnet, DVB_DEVICE_NET);
+	memset(dvbnet->state, 0, DVB_NET_DEVICES_MAX*sizeof(dvbnet->state[0]));
 
-	return 0;
+	return dvb_register_device(adap, &dvbnet->dvbdev, &dvbdev_net, dvbnet,
+				   DVB_DEVICE_NET);
 }
 EXPORT_SYMBOL(dvb_net_init);

_



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux