From: Axel Lin <axel.lin@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Przemo Firszt <przemo@firszt.eu>, Ping Cheng <pingc@wacom.com>,
linux-input@vger.kernel.org
Subject: [PATCH] HID: wacom: Fix wacom_probe error handling
Date: Mon, 17 Sep 2012 10:29:00 +0800 [thread overview]
Message-ID: <1347848940.20002.1.camel@phoenix> (raw)
In the case of goto destroy_leds, we also need to call hid_hw_stop(hdev) and
remove sysfs attribute files we created for speed and oleds.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/hid/hid-wacom.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index a0fafac..fae7fd7 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -902,10 +902,18 @@ OLED_INIT(7);
err_ac:
power_supply_unregister(&wdata->battery);
err_battery:
- device_remove_file(&hdev->dev, &dev_attr_speed);
- hid_hw_stop(hdev);
destroy_leds:
wacom_destroy_leds(hdev);
+ device_remove_file(&hdev->dev, &dev_attr_oled0_img);
+ device_remove_file(&hdev->dev, &dev_attr_oled1_img);
+ device_remove_file(&hdev->dev, &dev_attr_oled2_img);
+ device_remove_file(&hdev->dev, &dev_attr_oled3_img);
+ device_remove_file(&hdev->dev, &dev_attr_oled4_img);
+ device_remove_file(&hdev->dev, &dev_attr_oled5_img);
+ device_remove_file(&hdev->dev, &dev_attr_oled6_img);
+ device_remove_file(&hdev->dev, &dev_attr_oled7_img);
+ device_remove_file(&hdev->dev, &dev_attr_speed);
+ hid_hw_stop(hdev);
err_free:
kfree(wdata);
return ret;
--
1.7.9.5
next reply other threads:[~2012-09-17 2:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 2:29 Axel Lin [this message]
2012-09-17 8:28 ` [PATCH] HID: wacom: Fix wacom_probe error handling Przemo Firszt
2012-09-17 8:39 ` Axel Lin
2012-09-18 22:12 ` Przemo Firszt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347848940.20002.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=pingc@wacom.com \
--cc=przemo@firszt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox