aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-cougar.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-08-12 18:27:39 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-08-22 17:11:58 +0200
commit87fcb6a69e54527ccaeb5878168cccdba9f6b6ae (patch)
treee0aacd9f60504384cc942f0bdbb37ae9c7f04d63 /drivers/hid/hid-cougar.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid (diff)
downloadlinux-dev-87fcb6a69e54527ccaeb5878168cccdba9f6b6ae.tar.xz
linux-dev-87fcb6a69e54527ccaeb5878168cccdba9f6b6ae.zip
HID: do not call hid_set_drvdata(hdev, NULL) in drivers
This is a common pattern in the HID drivers to reset the drvdata. Some do it properly, some do it only in case of failure. But, this is actually already handled by driver core, so there is no need to do it manually. [for hid-sensor-hub.c] Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> [For hid-picolcd_core.c] Acked-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/hid-cougar.c')
-rw-r--r--drivers/hid/hid-cougar.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hid/hid-cougar.c b/drivers/hid/hid-cougar.c
index e0bb7b34f3a4..4ff3bc1d25e2 100644
--- a/drivers/hid/hid-cougar.c
+++ b/drivers/hid/hid-cougar.c
@@ -207,7 +207,7 @@ static int cougar_probe(struct hid_device *hdev,
error = hid_parse(hdev);
if (error) {
hid_err(hdev, "parse failed\n");
- goto fail;
+ return error;
}
if (hdev->collection->usage == COUGAR_VENDOR_USAGE) {
@@ -219,7 +219,7 @@ static int cougar_probe(struct hid_device *hdev,
error = hid_hw_start(hdev, connect_mask);
if (error) {
hid_err(hdev, "hw start failed\n");
- goto fail;
+ return error;
}
error = cougar_bind_shared_data(hdev, cougar);
@@ -249,8 +249,6 @@ static int cougar_probe(struct hid_device *hdev,
fail_stop_and_cleanup:
hid_hw_stop(hdev);
-fail:
- hid_set_drvdata(hdev, NULL);
return error;
}