From patchwork Tue Aug 4 06:09:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 6934211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E5F5EC05AD for ; Tue, 4 Aug 2015 06:12:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A41520641 for ; Tue, 4 Aug 2015 06:12:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C67F20626 for ; Tue, 4 Aug 2015 06:12:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZMVR4-0008Eo-Di; Tue, 04 Aug 2015 06:10:50 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZMVQr-00087J-G2 for linux-arm-kernel@lists.infradead.org; Tue, 04 Aug 2015 06:10:39 +0000 Received: by pacgq8 with SMTP id gq8so42710963pac.3 for ; Mon, 03 Aug 2015 23:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MA9u5E1vWUqdmxDaducIu0IYWmFRM2Xt6wkI5R9QXOo=; b=kKHmelhe5QdhYU6L4byGNgp+t8/JzQPTCjkU00I1Mr0hhpFuP/s4klT//9MH/aP/hy F3a5AFAvgxP75GSLexJ0cap1mjAEdf51j3SFe2BCyrxxO8WUkm1RheSJ/YM9/T8uRfgi qzX9PkFkVJmVMvno4iShvrUFR+Q0aBX/5ZLQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MA9u5E1vWUqdmxDaducIu0IYWmFRM2Xt6wkI5R9QXOo=; b=KiVo//1twjEwbTs5TcO/tIOEAHyYAdkvyRMK63M6HWi25a1qnwyDaxJ9H2hut7V3Ar a/4/XSQednFJxYwlIBomfhG9KKO+T9zDdr/7yjZqzXctk+20f1QIkq/xew6prYmhcTL+ kH3Tga1hcUWLFZe9JjmhoiYWkV6xswGufwBEbf157RisBbS5c8Ue1HLuMr2N3EjqLYcE 5wq5Z2v4NCC0r2q6/xn48LqT7NS61Zw8Q+2bQyEYAKV8kyO5vrFeyNUWBQUJ5zsKXPXm SortaL9abgi06P/D/Q5X8wNReJVI/S+6dup+EqXBAV7X4XubFfRJKS6Rp0KNP61GfS/O I4mg== X-Gm-Message-State: ALoCoQnZCPiDKPMkOx/Tx7XaEs3hcoy6xQ+7ufqylPkpQzGIhULt0yieIO3wTsLkrFEro+M3Jy1Q X-Received: by 10.69.26.38 with SMTP id iv6mr4179297pbd.151.1438668616496; Mon, 03 Aug 2015 23:10:16 -0700 (PDT) Received: from drinkcat.tpe.corp.google.com ([172.30.210.53]) by smtp.gmail.com with ESMTPSA id fv2sm9916456pbd.54.2015.08.03.23.10.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Aug 2015 23:10:16 -0700 (PDT) From: Nicolas Boichat To: Mark Brown Subject: [PATCH 3/3] spi: s3c24xx: Convert spinlock to mutex Date: Tue, 4 Aug 2015 14:09:58 +0800 Message-Id: <1438668598-6678-3-git-send-email-drinkcat@chromium.org> X-Mailer: git-send-email 2.5.0.rc2.392.g76e840b In-Reply-To: <1438668598-6678-1-git-send-email-drinkcat@chromium.org> References: <1438668598-6678-1-git-send-email-drinkcat@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150803_231037_725791_BD5F40E0 X-CRM114-Status: GOOD ( 12.90 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Kukjin Kim , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 bitbang->lock is now a mutex: replace spinlock function calls by mutex functions. Signed-off-by: Nicolas Boichat --- drivers/spi/spi-s3c24xx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c index f36bc32..b1d03e5 100644 --- a/drivers/spi/spi-s3c24xx.c +++ b/drivers/spi/spi-s3c24xx.c @@ -198,12 +198,11 @@ static int s3c24xx_spi_setup(struct spi_device *spi) if (ret) return ret; - spin_lock(&hw->bitbang.lock); - if (!hw->bitbang.busy) { + if (mutex_trylock(&hw->bitbang.lock)) { hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE); /* need to ndelay for 0.5 clocktick ? */ + mutex_unlock(&hw->bitbang.lock); } - spin_unlock(&hw->bitbang.lock); return 0; }