Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36089
b: refs/heads/master
c: 22f76e7
h: refs/heads/master
i:
  36087: 791e568
v: v3
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Sep 26, 2006
1 parent 5224d7f commit 91c7be9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3b3aadbbd66d8a020550b01b37d9b1ea559f2c3
refs/heads/master: 22f76e744dc41096987c6df8270b5c249511cde5
13 changes: 4 additions & 9 deletions trunk/drivers/i2c/i2c-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <linux/i2c-dev.h>
#include <asm/uaccess.h>

static struct i2c_client i2cdev_client_template;
static struct i2c_driver i2cdev_driver;

struct i2c_dev {
struct list_head list;
Expand Down Expand Up @@ -365,12 +365,13 @@ static int i2cdev_open(struct inode *inode, struct file *file)
if (!adap)
return -ENODEV;

client = kmalloc(sizeof(*client), GFP_KERNEL);
client = kzalloc(sizeof(*client), GFP_KERNEL);
if (!client) {
i2c_put_adapter(adap);
return -ENOMEM;
}
memcpy(client, &i2cdev_client_template, sizeof(*client));
snprintf(client->name, I2C_NAME_SIZE, "i2c-dev %d", adap->nr);
client->driver = &i2cdev_driver;

/* registered with adapter, passed as client to user */
client->adapter = adap;
Expand Down Expand Up @@ -459,12 +460,6 @@ static struct i2c_driver i2cdev_driver = {
.detach_client = i2cdev_detach_client,
};

static struct i2c_client i2cdev_client_template = {
.name = "I2C /dev entry",
.addr = -1,
.driver = &i2cdev_driver,
};

static int __init i2c_dev_init(void)
{
int res;
Expand Down

0 comments on commit 91c7be9

Please sign in to comment.