From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D8C011C01CA for ; Fri, 25 May 2018 16:55:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D5EBE883BB for ; Fri, 25 May 2018 16:55:06 +0000 (UTC) Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YET0PbzMEVmW for ; Fri, 25 May 2018 16:55:06 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0AF0B883AD for ; Fri, 25 May 2018 16:55:06 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id a15-v6so10342150wrm.0 for ; Fri, 25 May 2018 09:55:05 -0700 (PDT) From: Sergio Paracuellos Subject: [PATCH 4/7] staging: mt7621-gpio: avoid locking in mediatek_gpio_get_direction Date: Fri, 25 May 2018 18:54:50 +0200 Message-Id: <1527267293-1862-5-git-send-email-sergio.paracuellos@gmail.com> In-Reply-To: <1527267293-1862-1-git-send-email-sergio.paracuellos@gmail.com> References: <1527267293-1862-1-git-send-email-sergio.paracuellos@gmail.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org mediatek_gpio_get_direction function is holding across a simple read which it seems to be not neccessary at all. Just remove this locking cleaning code of this function a bit. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c index 79452eb..143268a 100644 --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c @@ -129,12 +129,7 @@ static int mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) { struct mtk_gc *rg = to_mediatek_gpio(chip); - unsigned long flags; - u32 t; - - spin_lock_irqsave(&rg->lock, flags); - t = mtk_gpio_r32(rg, GPIO_REG_CTRL); - spin_unlock_irqrestore(&rg->lock, flags); + u32 t = mtk_gpio_r32(rg, GPIO_REG_CTRL); return (t & BIT(offset)) ? 0 : 1; } -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel