[linux-dvb] [PATCH 4/4] budget-ci: kzalloc conversion, be slightly more verbose about IR init

Darren Salt linux at youmustbejoking.demon.co.uk
Wed Mar 22 18:38:25 CET 2006


Output some informational text on successful initialisation and an extra
error message (complementing existing messages) if the input device struct
couldn't be allocated.

Convert to kzalloc.

Signed-off-by: Darren Salt <linux at youmustbejoking.demon.co.uk>

diff --git a/linux/drivers/media/dvb/ttpci/budget-ci.c b/linux/drivers/media/dvb/ttpci/budget-ci.c
--- a/linux/drivers/media/dvb/ttpci/budget-ci.c	Wed Mar 22 16:26:21 2006
+++ b/linux/drivers/media/dvb/ttpci/budget-ci.c	Wed Mar 22 16:45:04 2006
@@ -197,8 +197,11 @@
 
 	budget_ci->ir.dev = input_dev = input_allocate_device();
 	if (!input_dev)
+	{
+		printk(KERN_ERR "budget_ci: IR interface initialisation failed\n");
 		return -ENOMEM;
+	}
 
 	snprintf(budget_ci->ir.name, sizeof(budget_ci->ir.name),
 		 "Budget-CI dvb ir receiver %s", saa->name);
 	snprintf(budget_ci->ir.phys, sizeof(budget_ci->ir.phys),
@@ -245,6 +248,7 @@
 	saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06);
 	saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI);
 
+	printk("budget_ci: IR interface initialised\n");
 	return 0;
 }
 
@@ -1032,7 +1036,7 @@
 	struct budget_ci *budget_ci;
 	int err;
 
-	if (!(budget_ci = kmalloc(sizeof(struct budget_ci), GFP_KERNEL)))
+	if (!(budget_ci = kzalloc(sizeof(struct budget_ci), GFP_KERNEL)))
 		return -ENOMEM;
 
 	dprintk(2, "budget_ci: %p\n", budget_ci);



More information about the linux-dvb mailing list