From patchwork Thu Nov 7 10:35:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 1191059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="nNyi8EhO"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4780DS2l4rz9sPk for ; Thu, 7 Nov 2019 21:35:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388149AbfKGKfs (ORCPT ); Thu, 7 Nov 2019 05:35:48 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:15857 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbfKGKfs (ORCPT ); Thu, 7 Nov 2019 05:35:48 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 07 Nov 2019 02:34:47 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 07 Nov 2019 02:35:47 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 07 Nov 2019 02:35:47 -0800 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 7 Nov 2019 10:35:46 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 7 Nov 2019 10:35:46 +0000 Received: from moonraker.nvidia.com (Not Verified[10.26.11.187]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7, 5, 8, 10121) id ; Thu, 07 Nov 2019 02:35:46 -0800 From: Jon Hunter To: Chris Packham , Linus Walleij , Bartosz Golaszewski CC: , , , , , Jon Hunter Subject: [PATCH] gpio: xgs-iproc: Fix crash when driver is built as a module Date: Thu, 7 Nov 2019 10:35:40 +0000 Message-ID: <20191107103540.21088-1-jonathanh@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1573122887; bh=RYTz0Jl2ILzETh0Xix36C/pYhL1SzsDNDWRscJE9ZBw=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=nNyi8EhO1rYJ1J2AFvbPB5V3Gc9ao9aXOAtKYzxodEnTaFv6A9IRjXfh2SZOcQahQ smnNE+U9rafERVPn9tuktXFSuAalgUfbKAA6kimXjn5wNAt67qHIWEu6sj5B/hpI6P UnRT4Z12P82gmpDtZd/Yjpwnn3z0iHJmryFL2L8dofsY3ieoIHsXI6XXFO92/pezot uaw1ogJAuDYxuJUQ/HD4oG9RoLhGfbuKTeIsE72DpH3qV8NWjZ4iydT+89is+2KCcV ZB5izp/MltbXpmlJJDZXaa2dfVQOvv3/JR0nT48c/aFjYsM6VVcIQLZrmPCA6gzUCT b+Zqfq/DV7D/A== Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Commit 6a41b6c5fc20 ("gpio: Add xgs-iproc driver") introduced a new GPIO driver for the Broadcom GPIO controller. When this driver is built as a module the following warning is observed because the bcm_iproc_gpio_of_match structure is defined with the __initconst attribute ... MODPOST vmlinux.o WARNING: vmlinux.o(.data+0x834d0): Section mismatch in reference from the variable bcm_iproc_gpio_driver to the variable .init.rodata:bcm_iproc_gpio_of_match The variable bcm_iproc_gpio_driver references the variable __initconst bcm_iproc_gpio_of_match This then causes a translation fault on boot which and results in a system crash. Fix this by dropping the __initconst attribute from the bcm_iproc_gpio_of_match structure. Signed-off-by: Jon Hunter --- drivers/gpio/gpio-xgs-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c index a3fdd95cc9e6..bb183f584d92 100644 --- a/drivers/gpio/gpio-xgs-iproc.c +++ b/drivers/gpio/gpio-xgs-iproc.c @@ -299,7 +299,7 @@ static int __exit iproc_gpio_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id bcm_iproc_gpio_of_match[] __initconst = { +static const struct of_device_id bcm_iproc_gpio_of_match[] = { { .compatible = "brcm,iproc-gpio-cca" }, {} };