From patchwork Tue Dec 4 22:43:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alex.theissen@me.com X-Patchwork-Id: 10712703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A16D117D5 for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9120F2B363 for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 855FF2C61C; Tue, 4 Dec 2018 23:00:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 330EF2C60C for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbeLDXA3 (ORCPT ); Tue, 4 Dec 2018 18:00:29 -0500 Received: from st43p00im-zteg10072001.me.com ([17.58.63.167]:59272 "EHLO st43p00im-zteg10072001.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbeLDXA3 (ORCPT ); Tue, 4 Dec 2018 18:00:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1543963831; bh=6Jma3Wq8QmdfwdoZvgt7l4LjkpaiTO7UTHTx8bE6Jzw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=dEFTZbebOn9Qt83xa5vFjpcZj0fmURoJ5RzQP+A3i/neo6cgkE3AZe4tvbEUPIuTu aG3TBNSplnsCjYN5fAeURbrA7ejk5JqN92S3xXmRdbji/i/MgZLhw5d2WfY12JGnda Rzpl7IUOWNWUjJrt2Yt+D28qDwrlkDxmnVjy8PlSpQ6W35ifEfps84lkIqXYU2Ww3T 5F3cGg1tD9JKCHIvEuLoZHWSvm9+4r3x4yKp2LBvJV/KcYs2JCUU56qrXX6O2ATJ32 Xpv+WdhkK7Y3Ui7Y3Z9RmootbtTAYbJhjDnhtkUYyVAlLCfMQx2rEBgRSdFL0h2507 5XCikBgMuakpg== Received: from alex-ubuntu.fritz.box (p4FE1EC73.dip0.t-ipconnect.de [79.225.236.115]) by st43p00im-zteg10072001.me.com (Postfix) with ESMTPSA id B9DABC40129; Tue, 4 Dec 2018 22:50:30 +0000 (UTC) From: alex.theissen@me.com To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Mattias Jacobsson <2pi@mok.nu>, Alexander Theissen Subject: [PATCH 3/3] usb: appledisplay: Remove unnecessary spinlock Date: Tue, 4 Dec 2018 23:43:37 +0100 Message-Id: <20181204224337.29122-4-alex.theissen@me.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181204224337.29122-1-alex.theissen@me.com> References: <20181204224337.29122-1-alex.theissen@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-04_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=795 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1812040196 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexander Theissen The spinlock was inside the urb completion function which is only called once per display and is then resubmitted from this function. There was no other place where this lock was used. Signed-off-by: Alexander Theissen --- drivers/usb/misc/appledisplay.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 2f3c4769238d..ac92725458b5 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -69,7 +69,6 @@ struct appledisplay { struct delayed_work work; int button_pressed; - spinlock_t lock; struct mutex sysfslock; /* concurrent read and write */ }; @@ -79,7 +78,6 @@ static void appledisplay_complete(struct urb *urb) { struct appledisplay *pdata = urb->context; struct device *dev = &pdata->udev->dev; - unsigned long flags; int status = urb->status; int retval; @@ -105,8 +103,6 @@ static void appledisplay_complete(struct urb *urb) goto exit; } - spin_lock_irqsave(&pdata->lock, flags); - switch(pdata->urbdata[1]) { case ACD_BTN_BRIGHT_UP: case ACD_BTN_BRIGHT_DOWN: @@ -119,8 +115,6 @@ static void appledisplay_complete(struct urb *urb) break; } - spin_unlock_irqrestore(&pdata->lock, flags); - exit: retval = usb_submit_urb(pdata->urb, GFP_ATOMIC); if (retval) { @@ -229,7 +223,6 @@ static int appledisplay_probe(struct usb_interface *iface, pdata->udev = udev; - spin_lock_init(&pdata->lock); INIT_DELAYED_WORK(&pdata->work, appledisplay_work); mutex_init(&pdata->sysfslock);