From: K. Y. Srinivasan Date: Wed, 16 May 2012 20:50:13 +0000 (-0700) Subject: HID: hyperv: Set the hid drvdata correctly X-Git-Tag: upstream/snapshot3+hdmi~7432^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b565a3906a92fe87b162cdcd11268589a36dc6dd;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git HID: hyperv: Set the hid drvdata correctly Set the hid drvdata prior to invoking hid_add_device() as hid_add_device() expects this state to be set. This bug was introduced in the recent hid changes that were made in 07d9ab4f0e52cb ("HID: hid-hyperv: Do not use hid_parse_report() directly"). Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c index 032e6c0..3d62781 100644 --- a/drivers/hid/hid-hyperv.c +++ b/drivers/hid/hid-hyperv.c @@ -516,11 +516,12 @@ static int mousevsc_probe(struct hv_device *device, sprintf(hid_dev->name, "%s", "Microsoft Vmbus HID-compliant Mouse"); + hid_set_drvdata(hid_dev, device); + ret = hid_add_device(hid_dev); if (ret) goto probe_err1; - hid_set_drvdata(hid_dev, device); ret = hid_parse(hid_dev); if (ret) {