Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269505
b: refs/heads/master
c: 15a564d
h: refs/heads/master
i:
  269503: 0bf35c5
v: v3
  • Loading branch information
Dmitry Torokhov committed Oct 11, 2011
1 parent f936748 commit 5dcc6c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: 8d92847700870e33cb92b43bde0a81f5a4298028
refs/heads/master: 15a564d8dbfc9429540c2d9b38a64d1909de8b24
14 changes: 9 additions & 5 deletions trunk/drivers/input/serio/serio_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ static bool serio_raw_fetch_byte(struct serio_raw *serio_raw, char *c)
return !empty;
}

static ssize_t serio_raw_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
static ssize_t serio_raw_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
{
struct serio_raw_client *client = file->private_data;
struct serio_raw *serio_raw = client->serio_raw;
Expand Down Expand Up @@ -187,7 +188,8 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, size_t cou
return retval;
}

static ssize_t serio_raw_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{
struct serio_raw_client *client = file->private_data;
struct serio_raw *serio_raw = client->serio_raw;
Expand Down Expand Up @@ -250,7 +252,7 @@ static const struct file_operations serio_raw_fops = {


/*********************************************************************
* Interface with serio port *
* Interface with serio port *
*********************************************************************/

static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
Expand Down Expand Up @@ -278,14 +280,16 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
struct serio_raw *serio_raw;
int err;

if (!(serio_raw = kzalloc(sizeof(struct serio_raw), GFP_KERNEL))) {
serio_raw = kzalloc(sizeof(struct serio_raw), GFP_KERNEL);
if (!serio_raw) {
dev_dbg(&serio->dev, "can't allocate memory for a device\n");
return -ENOMEM;
}

mutex_lock(&serio_raw_mutex);

snprintf(serio_raw->name, sizeof(serio_raw->name), "serio_raw%d", serio_raw_no++);
snprintf(serio_raw->name, sizeof(serio_raw->name),
"serio_raw%d", serio_raw_no++);
kref_init(&serio_raw->kref);
serio_raw->serio = serio;
INIT_LIST_HEAD(&serio_raw->client_list);
Expand Down

0 comments on commit 5dcc6c0

Please sign in to comment.