瀏覽代碼

HID: set proper dev.parent in hidraw

We need to properly set parent of the hidraw device (which is the
corresponding physical device itself) in order to hidraw devices not
end up under virtual device tree.

Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Jiri Kosina 16 年之前
父節點
當前提交
aae6c286da
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/hid/hidraw.c

+ 1 - 1
drivers/hid/hidraw.c

@@ -357,7 +357,7 @@ int hidraw_connect(struct hid_device *hid)
 		goto out;
 	}
 
-	dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor),
+	dev->dev = device_create(hidraw_class, &hid->dev, MKDEV(hidraw_major, minor),
 				 NULL, "%s%d", "hidraw", minor);
 
 	if (IS_ERR(dev->dev)) {