summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sony.c
diff options
context:
space:
mode:
authorRoderick Colenbrander <roderick.colenbrander@sony.com>2017-03-24 15:17:50 -0700
committerJiri Kosina <jkosina@suse.cz>2017-04-06 14:42:56 +0200
commita676bdc422241822130364443a6a65b6520440ba (patch)
tree8e62612e05405d407aa4b068e61d95947e733bbc /drivers/hid/hid-sony.c
parent77b499e739ed5561e5026fa7140ae53f6c4d1d8e (diff)
downloadlinux-a676bdc422241822130364443a6a65b6520440ba.tar.bz2
HID: sony: Make sure to unregister sensors on failure
Make sure we sure register any sensor when sony_input_configured failes. Somehow this line got lost during resolving of merge conflicts in the motion sensor patch series and a redudant remove was added as well later on. Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r--drivers/hid/hid-sony.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 444a3f04f047..e90ce63897df 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2696,6 +2696,8 @@ err_stop:
sony_leds_remove(sc);
if (sc->quirks & SONY_BATTERY_SUPPORT)
sony_battery_remove(sc);
+ if (sc->sensor_dev)
+ sony_unregister_sensors(sc);
sony_cancel_work_sync(sc);
kfree(sc->output_report_dmabuf);
sony_remove_dev_list(sc);
@@ -2786,9 +2788,6 @@ static void sony_remove(struct hid_device *hdev)
if (sc->sensor_dev)
sony_unregister_sensors(sc);
- if (sc->sensor_dev)
- sony_unregister_sensors(sc);
-
if (sc->quirks & DUALSHOCK4_CONTROLLER_BT)
device_remove_file(&sc->hdev->dev, &dev_attr_bt_poll_interval);