Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256638
b: refs/heads/master
c: 93b3790
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Jul 16, 2011
1 parent a564502 commit 0c2b075
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 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: d873d794235efa590ab3c94d5ee22bb1fab19ac4
refs/heads/master: 93b37905f70083d6143f5f4dba0a45cc64379a62
18 changes: 10 additions & 8 deletions trunk/drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,11 @@ static int fw_device_op_open(struct inode *inode, struct file *file)
init_waitqueue_head(&client->wait);
init_waitqueue_head(&client->tx_flush_wait);
INIT_LIST_HEAD(&client->phy_receiver_link);
INIT_LIST_HEAD(&client->link);
kref_init(&client->kref);

file->private_data = client;

mutex_lock(&device->client_list_mutex);
list_add_tail(&client->link, &device->client_list);
mutex_unlock(&device->client_list_mutex);

return nonseekable_open(inode, file);
}

Expand Down Expand Up @@ -451,15 +448,20 @@ static int ioctl_get_info(struct client *client, union ioctl_arg *arg)
if (ret != 0)
return -EFAULT;

mutex_lock(&client->device->client_list_mutex);

client->bus_reset_closure = a->bus_reset_closure;
if (a->bus_reset != 0) {
fill_bus_reset_event(&bus_reset, client);
if (copy_to_user(u64_to_uptr(a->bus_reset),
&bus_reset, sizeof(bus_reset)))
return -EFAULT;
ret = copy_to_user(u64_to_uptr(a->bus_reset),
&bus_reset, sizeof(bus_reset));
}
if (ret == 0 && list_empty(&client->link))
list_add_tail(&client->link, &client->device->client_list);

return 0;
mutex_unlock(&client->device->client_list_mutex);

return ret ? -EFAULT : 0;
}

static int add_client_resource(struct client *client,
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/firewire-cdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ union fw_cdev_event {
* of the bus. This does not cause a bus reset to happen.
* @bus_reset_closure: Value of &closure in this and subsequent bus reset events
* @card: The index of the card this device belongs to
*
* As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2)
* is started by this ioctl.
*/
struct fw_cdev_get_info {
__u32 version;
Expand Down

0 comments on commit 0c2b075

Please sign in to comment.