Skip to content

Commit

Permalink
Fixed stupidly introduced bug where it was trying to print debug info…
Browse files Browse the repository at this point in the history
… out to an uninitialised device pointer. Doh.
  • Loading branch information
ginge committed Feb 28, 2011
1 parent 9865887 commit 42fa41d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -116,7 +115,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
str[0] = 0;
for(j=0;j<pmsg->len;j++)
sprintf(str+strlen(str), "%x ", pmsg->buf[i]);
dev_info(&dev->i2c_adap.dev, " < %s", str);
printk(KERN_INFO " < %s", str);
}
#endif
} else {
Expand All @@ -127,7 +126,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
str[0] = 0;
for(j=0;j<pmsg->len;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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 42fa41d

Please sign in to comment.