aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-05-21 02:16:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-31 18:10:23 -0400
commit8891f41a78f27fcecf8faa58ca80dfd4bf336bff (patch)
treee23b128f6151da6292462d8bbe4e7d11a3511cd3
parent19a4fb21f804dbd5a327eba7a1569b6b8e941a54 (diff)
i2c-parport: use new parport device model
Modify i2c-parport driver to use the new parallel port device model. Tested-by: Jean Delvare <jdelvare@suse.de> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/i2c/busses/i2c-parport.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 155da957a92b..9b94c3db80ab 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -185,11 +185,15 @@ static void i2c_parport_attach(struct parport *port)
185 printk(KERN_ERR "i2c-parport: Failed to kzalloc\n"); 185 printk(KERN_ERR "i2c-parport: Failed to kzalloc\n");
186 return; 186 return;
187 } 187 }
188 memset(&i2c_parport_cb, 0, sizeof(i2c_parport_cb));
189 i2c_parport_cb.flags = PARPORT_FLAG_EXCL;
190 i2c_parport_cb.irq_func = i2c_parport_irq;
191 i2c_parport_cb.private = adapter;
188 192
189 pr_debug("i2c-parport: attaching to %s\n", port->name); 193 pr_debug("i2c-parport: attaching to %s\n", port->name);
190 parport_disable_irq(port); 194 parport_disable_irq(port);
191 adapter->pdev = parport_register_device(port, "i2c-parport", 195 adapter->pdev = parport_register_dev_model(port, "i2c-parport",
192 NULL, NULL, i2c_parport_irq, PARPORT_FLAG_EXCL, adapter); 196 &i2c_parport_cb, i);
193 if (!adapter->pdev) { 197 if (!adapter->pdev) {
194 printk(KERN_ERR "i2c-parport: Unable to register with parport\n"); 198 printk(KERN_ERR "i2c-parport: Unable to register with parport\n");
195 goto err_free; 199 goto err_free;
@@ -283,9 +287,10 @@ static void i2c_parport_detach(struct parport *port)
283} 287}
284 288
285static struct parport_driver i2c_parport_driver = { 289static struct parport_driver i2c_parport_driver = {
286 .name = "i2c-parport", 290 .name = "i2c-parport",
287 .attach = i2c_parport_attach, 291 .match_port = i2c_parport_attach,
288 .detach = i2c_parport_detach, 292 .detach = i2c_parport_detach,
293 .devmodel = true,
289}; 294};
290 295
291/* ----- Module loading, unloading and information ------------------------ */ 296/* ----- Module loading, unloading and information ------------------------ */