patch-2.4.25 linux-2.4.25/drivers/i2c/i2c-philips-par.c
Next file: linux-2.4.25/drivers/i2c/i2c-proc.c
Previous file: linux-2.4.25/drivers/i2c/i2c-keywest.c
Back to the patch index
Back to the overall index
- Lines: 82
- Date:
2004-02-18 05:36:31.000000000 -0800
- Orig file:
linux-2.4.24/drivers/i2c/i2c-philips-par.c
- Orig date:
2001-09-30 12:26:05.000000000 -0700
diff -urN linux-2.4.24/drivers/i2c/i2c-philips-par.c linux-2.4.25/drivers/i2c/i2c-philips-par.c
@@ -190,18 +190,18 @@
struct i2c_par *adapter = kmalloc(sizeof(struct i2c_par),
GFP_KERNEL);
if (!adapter) {
- printk("i2c-philips-par: Unable to malloc.\n");
+ printk(KERN_ERR "i2c-philips-par: Unable to malloc.\n");
return;
}
- printk("i2c-philips-par.o: attaching to %s\n", port->name);
+ printk(KERN_DEBUG "i2c-philips-par.o: attaching to %s\n", port->name);
adapter->pdev = parport_register_device(port, "i2c-philips-par",
NULL, NULL, NULL,
PARPORT_FLAG_EXCL,
NULL);
if (!adapter->pdev) {
- printk("i2c-philips-par: Unable to register with parport.\n");
+ printk(KERN_ERR "i2c-philips-par: Unable to register with parport.\n");
return;
}
@@ -212,13 +212,13 @@
/* reset hardware to sane state */
parport_claim_or_block(adapter->pdev);
- bit_lp_setsda(port, 1);
- bit_lp_setscl(port, 1);
+ adapter->bit_lp_data.setsda(port, 1);
+ adapter->bit_lp_data.setscl(port, 1);
parport_release(adapter->pdev);
if (i2c_bit_add_bus(&adapter->adapter) < 0)
{
- printk("i2c-philips-par: Unable to register with I2C.\n");
+ printk(KERN_ERR "i2c-philips-par: Unable to register with I2C.\n");
parport_unregister_device(adapter->pdev);
kfree(adapter);
return; /* No good */
@@ -250,41 +250,25 @@
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
static struct parport_driver i2c_driver = {
"i2c-philips-par",
i2c_parport_attach,
i2c_parport_detach,
NULL
};
-#endif
int __init i2c_bitlp_init(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,4)
- struct parport *port;
-#endif
- printk("i2c-philips-par.o: i2c Philips parallel port adapter module\n");
+ printk(KERN_INFO "i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_register_driver(&i2c_driver);
-#else
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_attach(port);
-#endif
return 0;
}
void __exit i2c_bitlp_exit(void)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_unregister_driver(&i2c_driver);
-#else
- struct parport *port;
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_detach(port);
-#endif
}
EXPORT_NO_SYMBOLS;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)