aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-03-14 00:09:16 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-03-14 00:09:16 -0500
commitb39787a972042ded183343b177d9c595b5704575 (patch)
treeff0336c45ff4f8bbb3e64af5cc16bcfe75fbb54b /drivers/input/serio
parent493a7e0d5614c30e1f3e56d59ab774300a2609f2 (diff)
Input: use kzalloc() throughout the code
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/hil_mlc.c3
-rw-r--r--drivers/input/serio/parkbd.c3
-rw-r--r--drivers/input/serio/rpckbd.c3
-rw-r--r--drivers/input/serio/serio_raw.c6
4 files changed, 5 insertions, 10 deletions
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c
index 5704204964a3..73aa8df84bcd 100644
--- a/drivers/input/serio/hil_mlc.c
+++ b/drivers/input/serio/hil_mlc.c
@@ -872,9 +872,8 @@ int hil_mlc_register(hil_mlc *mlc) {
872 for (i = 0; i < HIL_MLC_DEVMEM; i++) { 872 for (i = 0; i < HIL_MLC_DEVMEM; i++) {
873 struct serio *mlc_serio; 873 struct serio *mlc_serio;
874 hil_mlc_copy_di_scratch(mlc, i); 874 hil_mlc_copy_di_scratch(mlc, i);
875 mlc_serio = kmalloc(sizeof(*mlc_serio), GFP_KERNEL); 875 mlc_serio = kzalloc(sizeof(*mlc_serio), GFP_KERNEL);
876 mlc->serio[i] = mlc_serio; 876 mlc->serio[i] = mlc_serio;
877 memset(mlc_serio, 0, sizeof(*mlc_serio));
878 mlc_serio->id = hil_mlc_serio_id; 877 mlc_serio->id = hil_mlc_serio_id;
879 mlc_serio->write = hil_mlc_serio_write; 878 mlc_serio->write = hil_mlc_serio_write;
880 mlc_serio->open = hil_mlc_serio_open; 879 mlc_serio->open = hil_mlc_serio_open;
diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
index 1d15c2819818..a5c1fb3a4a51 100644
--- a/drivers/input/serio/parkbd.c
+++ b/drivers/input/serio/parkbd.c
@@ -171,9 +171,8 @@ static struct serio * __init parkbd_allocate_serio(void)
171{ 171{
172 struct serio *serio; 172 struct serio *serio;
173 173
174 serio = kmalloc(sizeof(struct serio), GFP_KERNEL); 174 serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
175 if (serio) { 175 if (serio) {
176 memset(serio, 0, sizeof(struct serio));
177 serio->id.type = parkbd_mode; 176 serio->id.type = parkbd_mode;
178 serio->write = parkbd_write, 177 serio->write = parkbd_write,
179 strlcpy(serio->name, "PARKBD AT/XT keyboard adapter", sizeof(serio->name)); 178 strlcpy(serio->name, "PARKBD AT/XT keyboard adapter", sizeof(serio->name));
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index a3bd11589bc3..513d37fc1acf 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -111,11 +111,10 @@ static int __devinit rpckbd_probe(struct platform_device *dev)
111{ 111{
112 struct serio *serio; 112 struct serio *serio;
113 113
114 serio = kmalloc(sizeof(struct serio), GFP_KERNEL); 114 serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
115 if (!serio) 115 if (!serio)
116 return -ENOMEM; 116 return -ENOMEM;
117 117
118 memset(serio, 0, sizeof(struct serio));
119 serio->id.type = SERIO_8042; 118 serio->id.type = SERIO_8042;
120 serio->write = rpckbd_write; 119 serio->write = rpckbd_write;
121 serio->open = rpckbd_open; 120 serio->open = rpckbd_open;
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
index 8734e7f75b7d..5a2703b536dc 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -96,12 +96,11 @@ static int serio_raw_open(struct inode *inode, struct file *file)
96 goto out; 96 goto out;
97 } 97 }
98 98
99 if (!(list = kmalloc(sizeof(struct serio_raw_list), GFP_KERNEL))) { 99 if (!(list = kzalloc(sizeof(struct serio_raw_list), GFP_KERNEL))) {
100 retval = -ENOMEM; 100 retval = -ENOMEM;
101 goto out; 101 goto out;
102 } 102 }
103 103
104 memset(list, 0, sizeof(struct serio_raw_list));
105 list->serio_raw = serio_raw; 104 list->serio_raw = serio_raw;
106 file->private_data = list; 105 file->private_data = list;
107 106
@@ -276,14 +275,13 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
276 struct serio_raw *serio_raw; 275 struct serio_raw *serio_raw;
277 int err; 276 int err;
278 277
279 if (!(serio_raw = kmalloc(sizeof(struct serio_raw), GFP_KERNEL))) { 278 if (!(serio_raw = kzalloc(sizeof(struct serio_raw), GFP_KERNEL))) {
280 printk(KERN_ERR "serio_raw.c: can't allocate memory for a device\n"); 279 printk(KERN_ERR "serio_raw.c: can't allocate memory for a device\n");
281 return -ENOMEM; 280 return -ENOMEM;
282 } 281 }
283 282
284 mutex_lock(&serio_raw_mutex); 283 mutex_lock(&serio_raw_mutex);
285 284
286 memset(serio_raw, 0, sizeof(struct serio_raw));
287 snprintf(serio_raw->name, sizeof(serio_raw->name), "serio_raw%d", serio_raw_no++); 285 snprintf(serio_raw->name, sizeof(serio_raw->name), "serio_raw%d", serio_raw_no++);
288 serio_raw->refcnt = 1; 286 serio_raw->refcnt = 1;
289 serio_raw->serio = serio; 287 serio_raw->serio = serio;