From patchwork Sat Feb 23 17:57:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 2178671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id CC18E3FCF6 for ; Sat, 23 Feb 2013 18:00:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U9JM8-00059j-LZ; Sat, 23 Feb 2013 17:57:52 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U9JM5-00058d-GM for linux-arm-kernel@lists.infradead.org; Sat, 23 Feb 2013 17:57:50 +0000 Received: from 178-25-111-196-dynip.superkabel.de ([178.25.111.196] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1U9JM4-0006DE-05; Sat, 23 Feb 2013 18:57:48 +0100 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Linus Walleij , Wolfram Sang Subject: [PATCH] i2c: s3c2410: check for NULL pinctrl handle Date: Sat, 23 Feb 2013 18:57:46 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) References: <201302231855.47560.heiko@sntech.de> In-Reply-To: <201302231855.47560.heiko@sntech.de> MIME-Version: 1.0 Message-Id: <201302231857.46445.heiko@sntech.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130223_125749_711870_86203783 X-CRM114-Status: GOOD ( 11.32 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 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: linux-samsung-soc@vger.kernel.org, Tomasz Figa , linux-kernel@vger.kernel.org, Kukjin Kim , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When pinctrl is not built the fallback functions fail silently and emit either 0 error codes or NULL pinctrl handles. Therefore it's needed to also check for this NULL-handle when falling back to parsing the i2c gpios from devicetree. Signed-off-by: Heiko Stuebner --- drivers/i2c/busses/i2c-s3c2410.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index f6b880b..e58337f 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -1060,7 +1060,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) if (i2c->pdata->cfg_gpio) { i2c->pdata->cfg_gpio(to_platform_device(i2c->dev)); - } else if (IS_ERR(i2c->pctrl) && s3c24xx_i2c_parse_dt_gpio(i2c)) { + } else if ((!i2c->pctrl || IS_ERR(i2c->pctrl)) && + s3c24xx_i2c_parse_dt_gpio(i2c)) { return -EINVAL; }