aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-parport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-parport.c')
-rw-r--r--drivers/i2c/busses/i2c-parport.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 71a2502fe069..2854d858fc9b 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -155,12 +155,11 @@ static void i2c_parport_attach (struct parport *port)
155{ 155{
156 struct i2c_par *adapter; 156 struct i2c_par *adapter;
157 157
158 adapter = kmalloc(sizeof(struct i2c_par), GFP_KERNEL); 158 adapter = kzalloc(sizeof(struct i2c_par), GFP_KERNEL);
159 if (adapter == NULL) { 159 if (adapter == NULL) {
160 printk(KERN_ERR "i2c-parport: Failed to kmalloc\n"); 160 printk(KERN_ERR "i2c-parport: Failed to kzalloc\n");
161 return; 161 return;
162 } 162 }
163 memset(adapter, 0x00, sizeof(struct i2c_par));
164 163
165 pr_debug("i2c-parport: attaching to %s\n", port->name); 164 pr_debug("i2c-parport: attaching to %s\n", port->name);
166 adapter->pdev = parport_register_device(port, "i2c-parport", 165 adapter->pdev = parport_register_device(port, "i2c-parport",
@@ -232,7 +231,7 @@ static void i2c_parport_detach (struct parport *port)
232 } 231 }
233} 232}
234 233
235static struct parport_driver i2c_driver = { 234static struct parport_driver i2c_parport_driver = {
236 .name = "i2c-parport", 235 .name = "i2c-parport",
237 .attach = i2c_parport_attach, 236 .attach = i2c_parport_attach,
238 .detach = i2c_parport_detach, 237 .detach = i2c_parport_detach,
@@ -250,12 +249,12 @@ static int __init i2c_parport_init(void)
250 type = 0; 249 type = 0;
251 } 250 }
252 251
253 return parport_register_driver(&i2c_driver); 252 return parport_register_driver(&i2c_parport_driver);
254} 253}
255 254
256static void __exit i2c_parport_exit(void) 255static void __exit i2c_parport_exit(void)
257{ 256{
258 parport_unregister_driver(&i2c_driver); 257 parport_unregister_driver(&i2c_parport_driver);
259} 258}
260 259
261MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>"); 260MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");