From patchwork Fri Mar 24 22:17:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roderick Colenbrander X-Patchwork-Id: 9644107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 741D5602C9 for ; Fri, 24 Mar 2017 22:18:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65FE623E64 for ; Fri, 24 Mar 2017 22:18:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5ADA026907; Fri, 24 Mar 2017 22:18:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86F1423E64 for ; Fri, 24 Mar 2017 22:18:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932944AbdCXWSE (ORCPT ); Fri, 24 Mar 2017 18:18:04 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:36248 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755019AbdCXWSD (ORCPT ); Fri, 24 Mar 2017 18:18:03 -0400 Received: by mail-it0-f44.google.com with SMTP id w124so22701936itb.1 for ; Fri, 24 Mar 2017 15:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaikai-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QHIB8QMrPvzhEA27wrMHy67XYzL+6N/gGjnYR6rH1uQ=; b=yaggqu6QwORZ2IYUBZGgqe85PkaioNdgBmL9kAl8YGz5QTxe9mLs6SfR4Jppb3au7W /yKIFDtfPPyAanyHqDd763Rzp6GiGZK4FniaYeKRewEGXCJB3XYqU+6nOIRNvvOtT1Tk VnuXzUM1nH3FBBRMNKGQgdbSGP38K5hzO3lBEoymhogsNLHvOfhBxyj+kgbIlfoHs+9Z herBNxrQJU6lv20k3AtRl2KXHqC811W4zzaOyidjjpm2QCZY3nxHjR0gXf/4ThOu2g5Y fX1+C8fOdnu+sGkd8ybf4JMc2AyWhiyAWp1k3sjgT0byfI68uFszYRlowU+QcaMO7G02 r60Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QHIB8QMrPvzhEA27wrMHy67XYzL+6N/gGjnYR6rH1uQ=; b=oGobikPv1usAZiPgufkn2VL7eDy6p6LIt6kgstUV2kfDck5IHhmUx9YlQ0RkQ7nu2t 9k6oBC/6kHw2oCgXsoFebJkErxAsawEnoVh39bGiQjVVGo7QtzMXqOV1xWAlML8jJIf6 2t+zCRuwe+u3IpYWsi1OlUxxtYVxvHDuRfG/PH2rpvMEoqbjVJoAlBQ9+u5y7rQgbbJf O4vR9AaQc2fdpmbxZj7Oraa1NWXuVupWLr/bWwSB1R5ezDdm71k7+Nd5KJmoW2fhPpbs BaSUXW+4hk5sRiRkedPxz8CViRj6v6uN0pWpanYZ0LH1LAOeXmXdKpDBwX2rSzFzMnYY wD9Q== X-Gm-Message-State: AFeK/H0SfUkZMv/SrC7Zb7QcV1vmizjPHCoCNHBUDLGZ9DkR6poCkT2TTNaVj3NbBlCjkYic X-Received: by 10.107.144.197 with SMTP id s188mr10190743iod.146.1490393882050; Fri, 24 Mar 2017 15:18:02 -0700 (PDT) Received: from roderick.ad.gaikai.biz ([100.42.98.197]) by smtp.gmail.com with ESMTPSA id m100sm1842120iod.14.2017.03.24.15.18.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 15:18:01 -0700 (PDT) From: Roderick Colenbrander To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Jiri Kosina , Benjamin Tissoires , Simon Wood , Frank Praznik , Tim Bird , Roderick Colenbrander Subject: [PATCH 6/6] HID: sony: Make sure to unregister sensors on failure Date: Fri, 24 Mar 2017 15:17:50 -0700 Message-Id: <20170324221750.19543-7-roderick@gaikai.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170324221750.19543-1-roderick@gaikai.com> References: <20170324221750.19543-1-roderick@gaikai.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roderick Colenbrander 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 --- drivers/hid/hid-sony.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index cf534a9..71c437f 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -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); if (sc->touchpad) sony_unregister_touchpad(sc); sony_cancel_work_sync(sc); @@ -2788,9 +2790,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);