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: 6934171 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 442DA9F373 for ; Tue, 4 Aug 2015 06:10:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6819620638 for ; Tue, 4 Aug 2015 06:10:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9412F20620 for ; Tue, 4 Aug 2015 06:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753213AbbHDGKq (ORCPT ); Tue, 4 Aug 2015 02:10:46 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36835 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753716AbbHDGKQ (ORCPT ); Tue, 4 Aug 2015 02:10:16 -0400 Received: by pacgq8 with SMTP id gq8so42710932pac.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=GAefCh7iIqWHPtKz+ec7rYJSDzL6TkgwiS3XU+SGaJM6fqKvpN4/ImkbKv2kwubFyz p6ZCmx+Fn6YXfQRnbt3Pdw6lF+oXnu2J0/OALBaK+uTB95A90UeKWrS4/Zq4ALXSnJw6 nhDXeRlqZv4/UxrIiMfrdv2uRh2ekQb60YzjmDYb9e8tj7cFIi3xO9AgqDyqfvgpl/XR 2pbyda4X1ClVqNc9WexRiJhIRbc389OjNeaWJohvc2MkQPSgQJv1T9c2yL8Jr/Bi0MDv Gevbh8QiLIzumjCObOgUgCd8oOOzUshTx8SFOYDP8fJ1uBADNj75wDudgiZJRADSOOCI h/bw== X-Gm-Message-State: ALoCoQmhUqXXScjY+VskGaeqawEALmQ7kjTcCc62LEbiTUuHsR7l9RS/zgou4IjqlQKQyve7wopO 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 Cc: Kukjin Kim , Krzysztof Kozlowski , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,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 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; }