Thanks to devres management, we don't need to remember a lot of failure
path. One or two is enough.

Note: changes to parse_and_register() have been removed from the import
of this patch to input-wacom.

Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
Acked-by: Ping Cheng <pi...@wacom.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
[aaron.sko...@wacom.com: Imported into input-wacom repository (3888b0d)]
Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
[aaron.sko...@wacom.com: Backported from input-wacom repository (5082afb)]
Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
---
 3.17/wacom_sys.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/3.17/wacom_sys.c b/3.17/wacom_sys.c
index 6acf07f..2dcd873 100644
--- a/3.17/wacom_sys.c
+++ b/3.17/wacom_sys.c
@@ -2077,7 +2077,7 @@ static int wacom_probe(struct hid_device *hdev,
 
        if (features->check_for_hid_type && features->hid_type != hdev->type) {
                error = -ENODEV;
-               goto fail_type;
+               goto fail;
        }
 
        wacom_wac->hid_data.inputmode = -1;
@@ -2094,12 +2094,12 @@ static int wacom_probe(struct hid_device *hdev,
        error = hid_parse(hdev);
        if (error) {
                hid_err(hdev, "parse failed\n");
-               goto fail_parse;
+               goto fail;
        }
 
        error = wacom_parse_and_register(wacom, false);
        if (error)
-               goto fail_parse;
+               goto fail;
 
        if (hdev->bus == BUS_BLUETOOTH) {
                error = device_create_file(&hdev->dev, &dev_attr_speed);
@@ -2111,8 +2111,7 @@ static int wacom_probe(struct hid_device *hdev,
 
        return 0;
 
-fail_parse:
-fail_type:
+fail:
        hid_set_drvdata(hdev, NULL);
        return error;
 }
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to