X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=drivers%2Fhid%2Fhid-elo.c;h=383dfda8c12fcede9f98bce23a21f55dfab22118;hb=bf9f243f23e6623f310ba03fbb14e10ec3a61290;hp=0d22713a38742b23465f0dbe216d2107c25edc52;hpb=76d7961ff4ee02cc70365600a52fb59ca544dc7c;p=linux-2.6-microblaze.git diff --git a/drivers/hid/hid-elo.c b/drivers/hid/hid-elo.c index 0d22713a3874..383dfda8c12f 100644 --- a/drivers/hid/hid-elo.c +++ b/drivers/hid/hid-elo.c @@ -228,13 +228,15 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) { struct elo_priv *priv; int ret; + struct usb_device *udev; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; INIT_DELAYED_WORK(&priv->work, elo_work); - priv->usbdev = interface_to_usbdev(to_usb_interface(hdev->dev.parent)); + udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent)); + priv->usbdev = usb_get_dev(udev); hid_set_drvdata(hdev, priv); @@ -265,6 +267,8 @@ static void elo_remove(struct hid_device *hdev) { struct elo_priv *priv = hid_get_drvdata(hdev); + usb_put_dev(priv->usbdev); + hid_hw_stop(hdev); cancel_delayed_work_sync(&priv->work); kfree(priv);