patch-2.1.31 linux/drivers/net/shaper.c

Next file: linux/drivers/net/sk_g16.c
Previous file: linux/drivers/net/seeq8005.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.30/linux/drivers/net/shaper.c linux/drivers/net/shaper.c
@@ -610,18 +610,11 @@
 
 int init_module(void)
 {
-	int i;
-	for(i=0;i<99;i++)
-	{
-		sprintf(devicename,"shaper%d",i);
-		if(dev_get(devicename)==NULL)
-			break;
-	}
-	if(i==100)
-		return -ENFILE;
-	
+	int err=dev_alloc_name(&dev_shape,"shaper%d");
+	if(err<0)
+		return err;
 	printk(SHAPER_BANNER);	
-	if (register_netdev(&dev_shape) != 0)
+	if (register_netdev(dev) != 0)
 		return -EIO;
 	printk("Traffic shaper initialised.\n");
 	return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov