From 42fa41daefe697b47768c2369d354d9d21c774d3 Mon Sep 17 00:00:00 2001 From: ginge <> Date: Mon, 28 Feb 2011 18:54:41 +0000 Subject: [PATCH] Fixed stupidly introduced bug where it was trying to print debug info out to an uninitialised device pointer. Doh. --- .../driver/Version_2/kernel/osif.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenServo/Interfaces/OpenServo_InterFace/driver/Version_2/kernel/osif.c b/OpenServo/Interfaces/OpenServo_InterFace/driver/Version_2/kernel/osif.c index 484b69c..a6a3d8c 100755 --- a/OpenServo/Interfaces/OpenServo_InterFace/driver/Version_2/kernel/osif.c +++ b/OpenServo/Interfaces/OpenServo_InterFace/driver/Version_2/kernel/osif.c @@ -69,7 +69,6 @@ static int usb_read(struct i2c_adapter *i2c_adap, int cmd, static int usb_write(struct i2c_adapter *adapter, int cmd, int value, int index, void *data, int len); -struct osif *dev = NULL; /* ----- begin of i2c layer ---------------------------------------------- */ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) @@ -116,7 +115,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) str[0] = 0; for(j=0;jlen;j++) sprintf(str+strlen(str), "%x ", pmsg->buf[i]); - dev_info(&dev->i2c_adap.dev, " < %s", str); + printk(KERN_INFO " < %s", str); } #endif } else { @@ -127,7 +126,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) str[0] = 0; for(j=0;jlen;j++) sprintf(str+strlen(str), "%x ", pmsg->buf[i]); - dev_info(&dev->i2c_adap.dev, " > %s", str); + printk(KERN_INFO " > %s", str); } #endif cmd = USBI2C_WRITE; @@ -167,7 +166,7 @@ static u32 usb_func(struct i2c_adapter *adapter) /* configure for I2c mode and SMBUS emulation */ u32 func = I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; - //dev_info(&dev->i2c_adap.dev, "got adapter functionality %x", func); + printk(KERN_INFO "OSIF: got adapter functionality %x", func); return func; } @@ -245,6 +244,7 @@ static void osif_free(struct osif *dev) { static int osif_probe(struct usb_interface *interface, const struct usb_device_id *id) { + struct osif *dev = NULL; int retval = -ENOMEM; u16 version; @@ -318,12 +318,12 @@ static int __init usb_osif_init(void) { int result; - dev_info(&dev->i2c_adap.dev, DRIVER_DESC " " DRIVER_VERSION " of " __DATE__); + printk( KERN_INFO DRIVER_DESC " " DRIVER_VERSION " of " __DATE__); /* register this driver with the USB subsystem */ result = usb_register(&osif_driver); if (result) - err("usb_register failed. Error number %d", result); + err("OSIF: usb_register failed. Error number %d", result); return result; }