From patchwork Fri Sep 28 14:28:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1519841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 14DEDDF283 for ; Fri, 28 Sep 2012 14:32:24 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THbZw-0003g7-RD; Fri, 28 Sep 2012 14:30:08 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THbZA-0003Wb-7f for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2012 14:29:21 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MB2003SXDKIH3D0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2012 23:29:15 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-3c-5065b43b1924 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 64.19.03783.B34B5605; Fri, 28 Sep 2012 23:29:15 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MB200E7BDK3XB70@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2012 23:29:15 +0900 (KST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 02/16] pinctrl: samsung: Detect and handle unsupported configuration types Date: Fri, 28 Sep 2012 16:28:33 +0200 Message-id: <1348842527-22460-3-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1348842527-22460-1-git-send-email-t.figa@samsung.com> References: <1348842527-22460-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPJMWRmVeSWpSXmKPExsVy+t9jAV3rLakBBi8mmllsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6Mt4/ushfcY6n41lvawPiZuYuRk0NCwERi5vaVjBC2mMSFe+vZ QGwhgUWMEicOhnUxcgHZm5kkVp0/ww6SYBNQk/jc8AisSERAQ2JK12OwOLPAZCaJYwvSQWxh gQSJxxNXgy1gEVCVuHL5ICuIzSvgJNF7/ifUYnmJp/f7gOZwcHAKOEusnacBsddJov9PA8sE Rt4FjAyrGEVTC5ILipPScw31ihNzi0vz0vWS83M3MYK9/UxqB+PKBotDjAIcjEo8vBYrUwKE WBPLiitzDzFKcDArifBmFKcGCPGmJFZWpRblxxeV5qQWH2KU5mBREudt9gCqFkhPLEnNTk0t SC2CyTJxcEo1MCqJSkWnZB7SKqtaXOVU+Pdd2p+fZ+OWng7s0wtffnR7mGipY81XzQwJbbeU ixme0Vd3KVhL2BvfzKtcrm0+f7LucpFp+QcmNN29nBV8ttDphorP1H/2Tz9+l9zvsc23qlpN 9lcq4yvGWS1PbB6JFU5S+qLSoaOvf9631OHLoce3V195MzXxlBJLcUaioRZzUXEiAPfyStXy AQAA X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.7 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.33 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, swarren@wwwdotorg.org, devicetree-discuss@lists.ozlabs.org, tomasz.figa@gmail.com, t.figa@samsung.com, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org, linus.walleij@linaro.org, m.szyprowski@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Tomasz Figa --- drivers/pinctrl/pinctrl-samsung.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index dd108a9..c660fa5 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c @@ -391,6 +391,9 @@ static int samsung_pinconf_rw(struct pinctrl_dev *pctldev, unsigned int pin, return -EINVAL; } + if (!width) + return -EINVAL; + mask = (1 << width) - 1; shift = pin_offset * width; data = readl(reg_base + cfg_reg);