From patchwork Fri Sep 18 00:54:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick X-Patchwork-Id: 7212091 Return-Path: X-Original-To: patchwork-linux-arm@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 E51B59F336 for ; Fri, 18 Sep 2015 01:11:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B531205E5 for ; Fri, 18 Sep 2015 01:11:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B77720435 for ; Fri, 18 Sep 2015 01:11:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZckBk-0003TQ-6K; Fri, 18 Sep 2015 01:10:08 +0000 Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zcjx6-000061-L4 for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2015 00:55:03 +0000 Received: by iofb144 with SMTP id b144so3935333iof.1 for ; Thu, 17 Sep 2015 17:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=XhF1E59Q2jWJWvbaur1dsehkolle6NJhYHF+IHIYnh4=; b=CWmNYY/eLw6iLivUG38YbZdXVJE6oBoUFCY0AjMqIHXtK8UdkAhrzEbjX4QDhm34zf WtU036o9mS7fNSRqGm0TPgcFYqAg0h4yk6Tk/gbSpyprnrNlgTIsnn215D9SlBFyEKZ2 4g98c+vyv2dsnLE1bikYJT6DpM/YaifRby8VtK4zVeEbOnB3FoXcQmRDqUAJX5kJxgXc fNmGqaAW1p3jZfX+KEY4iR6UGidXoY/VMH13sratHADU0A/t+u7xVbHlHCSc7eCfNG6G 688ujJPYOtZLsDo//32W8oCQzq6HniUQXW7iq2Vj6u0/PeNs5VKcOAtQYJURVxxkO5jq 8RYQ== X-Received: by 10.107.25.143 with SMTP id 137mr12078350ioz.52.1442537678410; Thu, 17 Sep 2015 17:54:38 -0700 (PDT) Received: from nick-System-Product-Name.hitronhub.home (CPEbc4dfb2691f3-CMbc4dfb2691f0.cpe.net.cable.rogers.com. [99.231.110.121]) by smtp.googlemail.com with ESMTPSA id f31sm2565404ioj.13.2015.09.17.17.54.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Sep 2015 17:54:37 -0700 (PDT) From: Nicholas Krause To: kgene@kernel.org Subject: [PATCH RESEND] mach:-s3c64xx:Cause kernel oops with WARN_ON if calls for setting up gpio fail in s3c64xx_i2s_cfg_gpio Date: Thu, 17 Sep 2015 20:54:34 -0400 Message-Id: <1442537674-26953-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150917_175501_349869_D2B927CD X-CRM114-Status: GOOD ( 13.50 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.kozlowski@samsung.com, linux-samsung-soc@vger.kernel.org, linux@arm.linux.org.uk, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 This fixes the function s3c64xx_i2c_cfg_gpio to cause a kernel oopes if the call to either s3c_gpio_cfgpin_range or s3c_gpio_cfgpin fail as we cannot continue to run on a board using this gpio setup if the configuration for the board fails when the gpio configuration of the board is being reconfigured in the function in s3c64xx_i2s_cfg_gpio. Signed-off-by: Nicholas Krause --- arch/arm/mach-s3c64xx/dev-audio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c index ff780a8..5e7538b 100644 --- a/arch/arm/mach-s3c64xx/dev-audio.c +++ b/arch/arm/mach-s3c64xx/dev-audio.c @@ -36,10 +36,10 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev) base = S3C64XX_GPE(0); break; case 2: - s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5)); - s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5)); - s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5)); - s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5)); + WARN_ON(s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5))); + WARN_ON(s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5))); + WARN_ON(s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5))); + WARN_ON(s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));) return 0; default: printk(KERN_DEBUG "Invalid I2S Controller number: %d\n", @@ -47,7 +47,7 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev) return -EINVAL; } - s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3)); + WARN_ON(s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3))); return 0; }