Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268377
b: refs/heads/master
c: 80e6238
h: refs/heads/master
i:
  268375: a6e97f6
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Sep 16, 2011
1 parent 2fca108 commit 0de97cb
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 2ddd5e5fb342b9f014d61941a4f73c0bd9b50a60
refs/heads/master: 80e623887ef6a86718ecab257c592e214ecad82d
18 changes: 9 additions & 9 deletions trunk/drivers/staging/hv/hv_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
atomic_cmpxchg(&input_dev->ref_count, 0, 2);

input_dev->device = device;
device->ext = input_dev;
hv_set_drvdata(device, input_dev);

return input_dev;
}
Expand All @@ -214,7 +214,7 @@ static struct mousevsc_dev *get_input_device(struct hv_device *device)
{
struct mousevsc_dev *input_dev;

input_dev = (struct mousevsc_dev *)device->ext;
input_dev = hv_get_drvdata(device);

/*
* FIXME
Expand All @@ -240,7 +240,7 @@ static struct mousevsc_dev *must_get_input_device(struct hv_device *device)
{
struct mousevsc_dev *input_dev;

input_dev = (struct mousevsc_dev *)device->ext;
input_dev = hv_get_drvdata(device);

if (input_dev && atomic_read(&input_dev->ref_count))
atomic_inc(&input_dev->ref_count);
Expand All @@ -254,7 +254,7 @@ static void put_input_device(struct hv_device *device)
{
struct mousevsc_dev *input_dev;

input_dev = (struct mousevsc_dev *)device->ext;
input_dev = hv_get_drvdata(device);

atomic_dec(&input_dev->ref_count);
}
Expand All @@ -266,7 +266,7 @@ static struct mousevsc_dev *release_input_device(struct hv_device *device)
{
struct mousevsc_dev *input_dev;

input_dev = (struct mousevsc_dev *)device->ext;
input_dev = hv_get_drvdata(device);

/* Busy wait until the ref drop to 2, then set it to 1 */
while (atomic_cmpxchg(&input_dev->ref_count, 2, 1) != 2)
Expand All @@ -282,13 +282,13 @@ static struct mousevsc_dev *final_release_input_device(struct hv_device *device)
{
struct mousevsc_dev *input_dev;

input_dev = (struct mousevsc_dev *)device->ext;
input_dev = hv_get_drvdata(device);

/* Busy wait until the ref drop to 1, then set it to 0 */
while (atomic_cmpxchg(&input_dev->ref_count, 1, 0) != 1)
udelay(100);

device->ext = NULL;
hv_set_drvdata(device, NULL);
return input_dev;
}

Expand Down Expand Up @@ -790,7 +790,7 @@ static int mousevsc_on_device_remove(struct hv_device *device)
int ret = 0;

pr_info("disabling input device (%p)...",
device->ext);
hv_get_drvdata(device));

input_dev = release_input_device(device);

Expand All @@ -808,7 +808,7 @@ static int mousevsc_on_device_remove(struct hv_device *device)
udelay(100);
}

pr_info("removing input device (%p)...", device->ext);
pr_info("removing input device (%p)...", hv_get_drvdata(device));

input_dev = final_release_input_device(device);

Expand Down

0 comments on commit 0de97cb

Please sign in to comment.