Skip to content

Commit

Permalink
HID: sony: Make sure to unregister sensors on failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roderick Colenbrander authored and Jiri Kosina committed Apr 6, 2017
1 parent 77b499e commit a676bdc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,8 @@ static int sony_input_configured(struct hid_device *hdev,
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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit a676bdc

Please sign in to comment.