summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-07-19 16:14:04 +0800
committerJiri Kosina <jkosina@suse.cz>2011-07-20 11:55:18 +0200
commit2dcd9543a28da523a179a13b1eefa5f9b8e05d72 (patch)
treea11707336226b54ec1f72c3e99a4f953cad1b088 /drivers/hid
parentb30d89d1055f9acd14b5eaf82d8f6a4763e91d85 (diff)
HID: emsff: properly handle emsff_init failure
emsff_init() may fail, let's properly handle the failure. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-emsff.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c
index 81877c67caea..a5dc13fe367b 100644
--- a/drivers/hid/hid-emsff.c
+++ b/drivers/hid/hid-emsff.c
@@ -126,7 +126,12 @@ static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err;
}
- emsff_init(hdev);
+ ret = emsff_init(hdev);
+ if (ret) {
+ dev_err(&hdev->dev, "force feedback init failed\n");
+ hid_hw_stop(hdev);
+ goto err;
+ }
return 0;
err: