OSDN Git Service

HID: logitech: Stop setting drvdata to NULL on probe failure and remove
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Sat, 20 Apr 2019 11:21:42 +0000 (13:21 +0200)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tue, 23 Apr 2019 15:59:01 +0000 (17:59 +0200)
There is no need to set drvdata to NULL on probe failure and remove,
the driver-core already does this for us.

[hdegoede@redhat.com: Isolate Logitech changes into a separate patch]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/hid/hid-logitech-dj.c
drivers/hid/hid-logitech-hidpp.c

index 826fa1e..a751012 100644 (file)
@@ -1094,7 +1094,6 @@ hid_hw_start_fail:
 hid_parse_fail:
        kfifo_free(&djrcv_dev->notif_fifo);
        kfree(djrcv_dev);
-       hid_set_drvdata(hdev, NULL);
        return retval;
 
 }
@@ -1145,7 +1144,6 @@ static void logi_dj_remove(struct hid_device *hdev)
 
        kfifo_free(&djrcv_dev->notif_fifo);
        kfree(djrcv_dev);
-       hid_set_drvdata(hdev, NULL);
 }
 
 static const struct hid_device_id logi_dj_receivers[] = {
index 29395da..965479f 100644 (file)
@@ -3231,15 +3231,15 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
        if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) {
                ret = wtp_allocate(hdev, id);
                if (ret)
-                       goto allocate_fail;
+                       return ret;
        } else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560) {
                ret = m560_allocate(hdev);
                if (ret)
-                       goto allocate_fail;
+                       return ret;
        } else if (hidpp->quirks & HIDPP_QUIRK_CLASS_K400) {
                ret = k400_allocate(hdev);
                if (ret)
-                       goto allocate_fail;
+                       return ret;
        }
 
        INIT_WORK(&hidpp->work, delayed_work_cb);
@@ -3334,8 +3334,6 @@ hid_parse_fail:
        sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
        cancel_work_sync(&hidpp->work);
        mutex_destroy(&hidpp->send_mutex);
-allocate_fail:
-       hid_set_drvdata(hdev, NULL);
        return ret;
 }