HID: hidraw, fix a NULL pointer dereference in hidraw_ioctl
[linux-2.6.git] / drivers / hid / hid-belkin.c
index 050b989..4ce7aa3 100644 (file)
@@ -54,16 +54,14 @@ static int belkin_probe(struct hid_device *hdev, const struct hid_device_id *id)
 
        hid_set_drvdata(hdev, (void *)quirks);
 
-       if (quirks & BELKIN_HIDDEV)
-               hdev->quirks |= HID_QUIRK_HIDDEV;
-
        ret = hid_parse(hdev);
        if (ret) {
                dev_err(&hdev->dev, "parse failed\n");
                goto err_free;
        }
 
-       ret = hid_hw_start(hdev);
+       ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT |
+               ((quirks & BELKIN_HIDDEV) ? HID_CONNECT_HIDDEV_FORCE : 0));
        if (ret) {
                dev_err(&hdev->dev, "hw start failed\n");
                goto err_free;
@@ -90,12 +88,12 @@ static struct hid_driver belkin_driver = {
        .probe = belkin_probe,
 };
 
-static int belkin_init(void)
+static int __init belkin_init(void)
 {
        return hid_register_driver(&belkin_driver);
 }
 
-static void belkin_exit(void)
+static void __exit belkin_exit(void)
 {
        hid_unregister_driver(&belkin_driver);
 }
@@ -103,5 +101,3 @@ static void belkin_exit(void)
 module_init(belkin_init);
 module_exit(belkin_exit);
 MODULE_LICENSE("GPL");
-
-HID_COMPAT_LOAD_DRIVER(belkin);