Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268572
b: refs/heads/master
c: 1b9bf62
h: refs/heads/master
v: v3
  • Loading branch information
Julian Andres Klode authored and Greg Kroah-Hartman committed Sep 30, 2011
1 parent 25874b1 commit 1c26ec8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 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: ff169c1487381aa522b92b9f0c87bd92577bfc80
refs/heads/master: 1b9bf629ea42fdacd951b9190f86b028557bbe19
11 changes: 9 additions & 2 deletions trunk/drivers/staging/nvec/nvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,16 @@ static void nvec_gpio_set_value(struct nvec_chip *nvec, int value)
gpio_set_value(nvec->gpio, value);
}

void nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
int nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
short size)
{
struct nvec_msg *msg;
unsigned long flags;

msg = nvec_msg_alloc(nvec);
if (msg == NULL)
return -ENOMEM;

msg->data[0] = size;
memcpy(msg->data + 1, data, size);
msg->size = size + 1;
Expand All @@ -170,6 +173,8 @@ void nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
spin_unlock_irqrestore(&nvec->tx_lock, flags);

queue_work(nvec->wq, &nvec->tx_work);

return 0;
}
EXPORT_SYMBOL(nvec_write_async);

Expand All @@ -181,7 +186,9 @@ struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
mutex_lock(&nvec->sync_write_mutex);

nvec->sync_write_pending = (data[1] << 8) + data[0];
nvec_write_async(nvec, data, size);

if (nvec_write_async(nvec, data, size) < 0)
return NULL;

dev_dbg(nvec->dev, "nvec_sync_write: 0x%04x\n",
nvec->sync_write_pending);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/nvec/nvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct nvec_chip {
int state;
};

extern void nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
extern int nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
short size);

extern struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
Expand Down

0 comments on commit 1c26ec8

Please sign in to comment.