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;
}
{
struct mousevsc_dev *input_dev;
- input_dev = (struct mousevsc_dev *)device->ext;
+ input_dev = hv_get_drvdata(device);
/*
* FIXME
{
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);
{
struct mousevsc_dev *input_dev;
- input_dev = (struct mousevsc_dev *)device->ext;
+ input_dev = hv_get_drvdata(device);
atomic_dec(&input_dev->ref_count);
}
{
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)
{
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;
}
int ret = 0;
pr_info("disabling input device (%p)...",
- device->ext);
+ hv_get_drvdata(device));
input_dev = release_input_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);