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: 6934151 Return-Path: X-Original-To: patchwork-linux-spi@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 DF77AC05AC for ; Tue, 4 Aug 2015 06:10:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0878E20626 for ; Tue, 4 Aug 2015 06:10:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3ACE420620 for ; Tue, 4 Aug 2015 06:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753920AbbHDGKY (ORCPT ); Tue, 4 Aug 2015 02:10:24 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33466 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753787AbbHDGKR (ORCPT ); Tue, 4 Aug 2015 02:10:17 -0400 Received: by padck2 with SMTP id ck2so75106pad.0 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=i5u9J5hcWqOuJwIyrgVxqIVPyi5sTByvUDJNH4+IyQVZ5kClabeaFEoGoZj4gG8aVJ 1K7FFU6b9onzMK3dENroq2thLwJqGE8+Y3SecnlCgvtOBREft4p5i8GxvxvPWlCU9uS4 a9uqLLyWncm1IXdjvBePhccyyo+e63rgmr32rBQ3hbzqwf/+HMvHlBObJB3/8r1qXnQy TXCKtayRodyJLzw9yyMqGZi6Qtxsr1WmCkJ/bNokMba7SQMmTEwfQmOu2+YjyXvtYDfM M4pgFIbv3VsNGt5eVUJTqq4j1Jy6rsKQSahGJ0aV93T6ADcGZsdc/Rm9+WDkACuZRVPJ snkQ== X-Gm-Message-State: ALoCoQl3BCPbfXlAG7ChMwhjeuLDWXHDbx/dQOfme4Ie75pp7VAl/lHnnutLfAC0O8c6X/fgZW2e 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-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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; }