From patchwork Tue Nov 19 19:26:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 3203761 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 736289F243 for ; Tue, 19 Nov 2013 19:26:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DEAF20529 for ; Tue, 19 Nov 2013 19:26:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A29320523 for ; Tue, 19 Nov 2013 19:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752197Ab3KST0k (ORCPT ); Tue, 19 Nov 2013 14:26:40 -0500 Received: from narfation.org ([79.140.41.39]:42235 "EHLO v3-1039.vlinux.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751650Ab3KST0k (ORCPT ); Tue, 19 Nov 2013 14:26:40 -0500 Received: from sven-desktop.home.narfation.org (drsd-4d05afb0.pool.mediaWays.net [77.5.175.176]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 526C21100BD; Tue, 19 Nov 2013 20:26:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=20121; t=1384889199; bh=2pTNnIrIGYhaDyKKnQPdq282gunF8Gf2R/JyDaLN7Tg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ybKSx9GhlgkorWUZM/hq5OI6zgj7v7i2KW+iCofXv48mPNfqAKxg3kDxoKdT/Q63s Nq7NIGhabDyn+VOhd629JOV0Uyksin6+F6vJ0PP72XQlTMyKkDKxzyYcyOSL3ME6DT Xnf0DrV2KqrAbPH0vUGf2y6Ppn6k8wdlRRAGTeTU= From: Sven Eckelmann To: linux-input@vger.kernel.org Cc: Jiri Kosina , Sven Eckelmann Subject: [PATCHv4 1/5] HID: sony: Rename rumble_* functions/variables to state_* Date: Tue, 19 Nov 2013 20:26:28 +0100 Message-Id: <1384889192-18488-2-git-send-email-sven@narfation.org> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1384889192-18488-1-git-send-email-sven@narfation.org> References: <1384889192-18488-1-git-send-email-sven@narfation.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The commands used to modify the rumble motor state also modifies the LEDs at the same time. The functionality used to modify this state in the driver has to be shared between the rumble and LED part. It is therefore better to replace the "rumble" part of the names with "state". Signed-off-by: Sven Eckelmann --- drivers/hid/hid-sony.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 098af2f8..28b847a 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -226,7 +226,7 @@ struct sony_sc { unsigned long quirks; #ifdef CONFIG_SONY_FF - struct work_struct rumble_worker; + struct work_struct state_worker; struct hid_device *hdev; __u8 left; __u8 right; @@ -622,9 +622,9 @@ static void buzz_remove(struct hid_device *hdev) } #ifdef CONFIG_SONY_FF -static void sony_rumble_worker(struct work_struct *work) +static void sony_state_worker(struct work_struct *work) { - struct sony_sc *sc = container_of(work, struct sony_sc, rumble_worker); + struct sony_sc *sc = container_of(work, struct sony_sc, state_worker); unsigned char buf[] = { 0x01, 0x00, 0xff, 0x00, 0xff, 0x00, @@ -655,7 +655,7 @@ static int sony_play_effect(struct input_dev *dev, void *data, sc->left = effect->u.rumble.strong_magnitude / 256; sc->right = effect->u.rumble.weak_magnitude ? 1 : 0; - schedule_work(&sc->rumble_worker); + schedule_work(&sc->state_worker); return 0; } @@ -667,7 +667,7 @@ static int sony_init_ff(struct hid_device *hdev) struct sony_sc *sc = hid_get_drvdata(hdev); sc->hdev = hdev; - INIT_WORK(&sc->rumble_worker, sony_rumble_worker); + INIT_WORK(&sc->state_worker, sony_state_worker); input_set_capability(input_dev, EV_FF, FF_RUMBLE); return input_ff_create_memless(input_dev, NULL, sony_play_effect); @@ -677,7 +677,7 @@ static void sony_destroy_ff(struct hid_device *hdev) { struct sony_sc *sc = hid_get_drvdata(hdev); - cancel_work_sync(&sc->rumble_worker); + cancel_work_sync(&sc->state_worker); } #else