From patchwork Mon Apr 18 19:55:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 8874831 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CBB609F441 for ; Mon, 18 Apr 2016 20:02:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFB30201BC for ; Mon, 18 Apr 2016 20:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE8BF2012B for ; Mon, 18 Apr 2016 20:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbcDRUCA (ORCPT ); Mon, 18 Apr 2016 16:02:00 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.217]:57316 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbcDRUB7 (ORCPT ); Mon, 18 Apr 2016 16:01:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1461009716; l=2071; s=domk; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Date:Subject:Cc:To: From; bh=tKckQfQ1VcOyRvUNQLWwtQ2hfEAkKO6fdIUz2mcjYZM=; b=MPiY98rCmObWal/NpliEDWMKQbwJi0CuCdR9eJDlX1FKoi9ielXdyPceOOI68gctneQ Qr7VKhNUkNZ3MheEenrKZDxVE/V72/wvW5A4f/TX2VIfBHARA0YW321tQxMxAiGyldwO+ nJgV3cqbP9kHrp1wPOdsnDUfLQ5Y9zfIeQo= X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcecEarQROEYabkiUo6mSAGQ+qKIDwxPMIbzQ== X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain (p57AE1B2F.dip0.t-ipconnect.de [87.174.27.47]) by smtp.strato.de (RZmta 37.23 DYNA|AUTH) with ESMTPA id 205168s3IJti2V7; Mon, 18 Apr 2016 21:55:44 +0200 (CEST) From: "H. Nikolaus Schaller" To: Dmitry Torokhov , Fabio Estevam , Peter Ujfalusi , "H. Nikolaus Schaller" Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pyra-handheld.com, letux-kernel@openphoenux.org Subject: [PATCH 5/5] input: twl6040-vibra: remove mutex Date: Mon, 18 Apr 2016 21:55:41 +0200 Message-Id: <592912a81a86fe0c9b5eaf3407cc5c4e1bfef9fe.1461009340.git.hns@goldelico.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 mutex does not seem to be needed. twl4030-vibra doesn't use one either. Signed-off-by: H. Nikolaus Schaller --- drivers/input/misc/twl6040-vibra.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 69c5940..dcc926b 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c @@ -46,7 +46,7 @@ struct vibra_info { struct device *dev; struct input_dev *input_dev; struct work_struct play_work; - struct mutex mutex; + int irq; bool enabled; @@ -182,8 +182,6 @@ static void vibra_play_work(struct work_struct *work) struct vibra_info *info = container_of(work, struct vibra_info, play_work); - mutex_lock(&info->mutex); - if (info->weak_speed || info->strong_speed) { if (!info->enabled) twl6040_vibra_enable(info); @@ -192,7 +190,6 @@ static void vibra_play_work(struct work_struct *work) } else if (info->enabled) twl6040_vibra_disable(info); - mutex_unlock(&info->mutex); } static int vibra_play(struct input_dev *input, void *data, @@ -223,12 +220,8 @@ static void twl6040_vibra_close(struct input_dev *input) cancel_work_sync(&info->play_work); - mutex_lock(&info->mutex); - if (info->enabled) twl6040_vibra_disable(info); - - mutex_unlock(&info->mutex); } static int __maybe_unused twl6040_vibra_suspend(struct device *dev) @@ -236,13 +229,9 @@ static int __maybe_unused twl6040_vibra_suspend(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct vibra_info *info = platform_get_drvdata(pdev); - mutex_lock(&info->mutex); - if (info->enabled) twl6040_vibra_disable(info); - mutex_unlock(&info->mutex); - return 0; } @@ -301,8 +290,6 @@ static int twl6040_vibra_probe(struct platform_device *pdev) return -EINVAL; } - mutex_init(&info->mutex); - error = devm_request_threaded_irq(&pdev->dev, info->irq, NULL, twl6040_vib_irq_handler, IRQF_ONESHOT,