From patchwork Wed Aug 8 14:47:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10592 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 6640223E53 for ; Wed, 8 Aug 2012 14:47:48 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 36840A190A9 for ; Wed, 8 Aug 2012 14:47:45 +0000 (UTC) Received: by ghbg10 with SMTP id g10so847675ghb.11 for ; Wed, 08 Aug 2012 07:47:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=pz83oSCKC3fqb7jxnSlOG53NSjK6hU9qeMaYI3192+0=; b=lLQIBj9/hv8PfNbjPi35ZyRuauLHTSsOmNmz5v4RCY2ENVoYzwrZ/srGTcv3tmqNG9 RTBkE2YS1GpDwSbd5IeESjHV/ueWVMV6+vNF8NzWlVA+126AV41FxDkVE1aJKJgyBHOb cYVqlrmXGLh/gOrBY2gVb1McZeMYGhBTYrnBwTVXuvCu3a4v942WJidvO/hoQWJwVFmC aoMza1JLKD4jeMIy3gxseRsvVvxBR3mFNEq9dF0WD4nyF/QOTGQD7tXMWISe9sJxv+Fb pyEt+1kd7pxdqpGgcpn8nsM7SyVCYW0ZHTW5t/awPfIeSZ8neJkvNEOboREpZDYpZpaz 8xKg== Received: by 10.50.57.168 with SMTP id j8mr42816igq.16.1344437263176; Wed, 08 Aug 2012 07:47:43 -0700 (PDT) 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.50.184.200 with SMTP id ew8csp611869igc; Wed, 8 Aug 2012 07:47:42 -0700 (PDT) Received: by 10.217.2.146 with SMTP id p18mr9808554wes.198.1344437262009; Wed, 08 Aug 2012 07:47:42 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.9]) by mx.google.com with ESMTP id dw10si6950564wib.8.2012.08.08.07.47.41; Wed, 08 Aug 2012 07:47:42 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.9 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.9; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.9 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LoKJV-1TfJ3m0d45-00gkxB; Wed, 08 Aug 2012 16:47:35 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: arm@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Magnus Damm , Linus Walleij , "Rafael J. Wysocki" Subject: [PATCH 06/11] gpio: em: do not discard em_gio_irq_domain_cleanup Date: Wed, 8 Aug 2012 16:47:23 +0200 Message-Id: <1344437248-20560-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344437248-20560-1-git-send-email-arnd@arndb.de> References: <1344437248-20560-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:kYcpDsibcRvmGX0c1Q1GKw/zjB7CACtx7xRzF0IPMdr QThNqOPrYkHeeCv6tvYFpVWqRLUVxGPEC6acaRPOKFQDaScwQ6 7UOJwC+1VeW//zxuJMqdqUdE/PrUAbqrgsqhDSVvNE6KCUpGSg qvsB3hqP4l8Ot2mgeLSQKT7zBd8f/hLX+YNdk2rvESF/1pe8cg qxxLHXVui9JaAv3hcQBsmCPaTxieWQXKNiQnhfeSuuMIo8GV/d XvCWmbly7K4pOuAOTT8JRe6d/1doDEApsdm9EExpKTwLj18ims oI10xDGTD94A816ni8aP6iErbsMuSt7WvzCIezSIHEMRqwAXyp HkHtRLAwHAeZFAPjISrxiaQlWSszyVfcjTnmyQxCEjuPBO7P9S Y/UxJEZndvNCU/pwLn8arzxeCq5Hjx3H3o= X-Gm-Message-State: ALoCoQkGxx7+00nvuayOa2WRw17C20FAX/onzoQVoZkNy/LjgWkT63ZP8wB+mCaS5pOAx1PSKwKa The newly added gpio-em driver marks its em_gio_irq_domain_cleanup function as __devexit, which would lead to that function being discarded in case CONFIG_HOTPLUG is disabled. However, the function is also called by the error handling logic em_gio_probe, which would cause a jump into a NULL pointer if it was removed from the kernel or module. Without this patch, building kzm9d_defconfig results in: WARNING: drivers/gpio/built-in.o(.devinit.text+0x330): Section mismatch in reference from the function em_gio_probe() to the function .devexit.text:em_gio_irq_domain_cleanup() The function __devinit em_gio_probe() references a function __devexit em_gio_irq_domain_cleanup(). This is often seen when error handling in the init function uses functionality in the exit path. The fix is often to remove the __devexit annotation of em_gio_irq_domain_cleanup() so it may be used outside an exit section. Signed-off-by: Arnd Bergmann Cc: Magnus Damm Cc: Linus Walleij Cc: Rafael J. Wysocki --- drivers/gpio/gpio-em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index 150d976..ae37181 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -266,7 +266,7 @@ static int __devinit em_gio_irq_domain_init(struct em_gio_priv *p) return 0; } -static void __devexit em_gio_irq_domain_cleanup(struct em_gio_priv *p) +static void em_gio_irq_domain_cleanup(struct em_gio_priv *p) { struct gpio_em_config *pdata = p->pdev->dev.platform_data;