From patchwork Thu Mar 8 13:01:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 7165 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D6B0C23E3E for ; Thu, 8 Mar 2012 13:02:04 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 9694DA185E4 for ; Thu, 8 Mar 2012 13:02:04 +0000 (UTC) Received: by iage36 with SMTP id e36so883900iag.11 for ; Thu, 08 Mar 2012 05:02:04 -0800 (PST) Received: by 10.50.158.133 with SMTP id wu5mr16963360igb.50.1331211723982; Thu, 08 Mar 2012 05:02:03 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp8690ibg; Thu, 8 Mar 2012 05:02:03 -0800 (PST) Received: by 10.14.98.143 with SMTP id v15mr2235248eef.90.1331211722706; Thu, 08 Mar 2012 05:02:02 -0800 (PST) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com. [207.126.144.149]) by mx.google.com with SMTP id v16si1000018eem.35.2012.03.08.05.01.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Mar 2012 05:02:02 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.149; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKT1itwRdqvrCKvnnGwxLOD7KaJycs5Obl@postini.com; Thu, 08 Mar 2012 13:01:57 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 83B26690; Thu, 8 Mar 2012 13:01:52 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0A2B02014; Thu, 8 Mar 2012 13:01:52 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id C55A1A8065; Thu, 8 Mar 2012 14:01:46 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 8 Mar 2012 14:01:51 +0100 From: Linus Walleij To: Samuel Ortiz , Cc: Rabin Vincent , Linus Walleij Subject: [PATCH 1/4] mfd/ab8500: don't use mutex_lock_interruptible Date: Thu, 8 Mar 2012 14:01:46 +0100 Message-ID: <1331211706-9763-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.8 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmNA1jzPxWRJBSwqjmpQr293hV7dh9bopq+zl49MmkIxq13BMPhxeH+NFPg7+Ncl5KgvxW9 From: Rabin Vincent This disadvantage of having it interruptible is that it would appear to work OK in most situations, but in the rare case that this call does fail, it can lead to misconfiguration of the AB, such as a regulator not being turned off and leading to a platform power consumption increase. There's no real benefit to having this interruptible. Make it a plain mutex_lock. The non-interruptability matches other low-level I/O functions such as SPI and I2C. Signed-off-by: Rabin Vincent Signed-off-by: Linus Walleij --- drivers/mfd/ab8500-core.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 15a18fe..f134a6c 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -147,9 +147,7 @@ static int set_register_interruptible(struct ab8500 *ab8500, u8 bank, dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data); - ret = mutex_lock_interruptible(&ab8500->lock); - if (ret) - return ret; + mutex_lock(&ab8500->lock); ret = ab8500->write(ab8500, addr, data); if (ret < 0) @@ -176,9 +174,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, * bank on higher 8 bits and reg in lower */ u16 addr = ((u16)bank) << 8 | reg; - ret = mutex_lock_interruptible(&ab8500->lock); - if (ret) - return ret; + mutex_lock(&ab8500->lock); ret = ab8500->read(ab8500, addr); if (ret < 0) @@ -210,9 +206,7 @@ static int mask_and_set_register_interruptible(struct ab8500 *ab8500, u8 bank, * bank on higher 8 bits and reg in lower */ u16 addr = ((u16)bank) << 8 | reg; - ret = mutex_lock_interruptible(&ab8500->lock); - if (ret) - return ret; + mutex_lock(&ab8500->lock); ret = ab8500->read(ab8500, addr); if (ret < 0) {