From patchwork Mon Mar 27 15:16:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 96078 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1275178qgd; Mon, 27 Mar 2017 08:17:46 -0700 (PDT) X-Received: by 10.84.215.23 with SMTP id k23mr29202500pli.58.1490627866907; Mon, 27 Mar 2017 08:17:46 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id f126si691090pfg.135.2017.03.27.08.17.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2017 08:17:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=gZBaMRtKi1Ig1CYoSumcVZ8elcMJjcBgUY7zYX8FRMg=; b=j0q BH1KS7T365oDo0XzSaHI0m39z4FS2b/EUDzMuuiJWJm+Z6LNYdY3UnElBNgx+rEX8aZ9eLkNL4NgF szzD3MDr8sKxV0D6+T6tDYR+WCGV9tlJ59tWFI0VvDaEPg2wHZv5oJ8dqSEDTBLKwg3OX2Lus4p6X f1BccXntUR7ue9Lg8NZuR6OUT6pN7wRqc3B5qEbuS2gWnYG+lvtW8cik9n9JPcae3K4HFsDqknVtr KIJUzwpFSr8KfeH2cEpkBvz1RCydOUdGcf73LRHhctRrX6rPTavRx5thKaTHV+ITmCFkFJ3OGgHhX kIbfkOXpLI8xsVbp3W3xqVXo3Dx1jrA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1csWOq-0005mV-0S; Mon, 27 Mar 2017 15:17:40 +0000 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1csWOd-0005WM-Ib for linux-mtd@lists.infradead.org; Mon, 27 Mar 2017 15:17:30 +0000 Received: by mail-lf0-x229.google.com with SMTP id h125so23919705lfe.0 for ; Mon, 27 Mar 2017 08:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Y7PIEyWtuVRHbZsRYU8Z0AF7Suw0wWtSwXw4h5+IFnQ=; b=ZOzHKR44YQfEBgBhA5L0NcD5Do/jmi1PXvlD0TJgLVENfd/ENnoc0s8PTJEgDIAywL OAGlyGebjLrXbAZ2Uw8AmARIkUepNvRi1T1k91+BMYRrsRssJ8/bBcQQkHYAZUbDJfEl pm4Mw/QmtXctcisAZZjulO9mxxDcLCTHAlQKU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Y7PIEyWtuVRHbZsRYU8Z0AF7Suw0wWtSwXw4h5+IFnQ=; b=ElbccBrjIEr6K7sKtW7igSLAQH2x3EUBuKW/jCkl2OTuOt8CunRd5xYWilk+oyjtw6 0TQmZzwnwYikhO+MuKHKzvtx4FKTd93+kpFI5L8U5iUO6YHjIhGQo0KItuIksilIUJzU z/kNmEGdGFu8zuVyTpYo0rZkzV8B/JnDWw++ym3woGW1kMiNr9WrVT/SiAgdWS0hVRYI 95NhPPSRTN1zBtj4l7iwM8HESkbD6cmTWQQdf+GTMXBnrrqFQ4BQbjJMrgwZPAsVGyQz Qt+4T4DA2nLWk6T2EYluRQG3aidLw3Z0eXR3VBi09JzQvF2Gr5omX+Sz6JHsKlDr+5t2 afcA== X-Gm-Message-State: AFeK/H13TxyQaf5nHGp8uV/T8we6X0exbbfbfNXa9IndiWCnt701xXTgYwE0dPjjcBFSLau7 X-Received: by 10.25.198.19 with SMTP id w19mr11696776lff.175.1490627822625; Mon, 27 Mar 2017 08:17:02 -0700 (PDT) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id n20sm170299lfb.53.2017.03.27.08.17.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2017 08:17:01 -0700 (PDT) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-mtd@lists.infradead.org Subject: [PATCH v2] mtd: physmap_of: really fix the physmap add-ons Date: Mon, 27 Mar 2017 17:16:58 +0200 Message-Id: <20170327151658.6175-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170327_081727_885975_AF1D632A X-CRM114-Status: GOOD ( 15.68 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:229 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The current way of building the of_physmap add-ons result in just the add-on being in the object code, and not the actual core implementation and regress the Gemini and Versatile. There is no way around exporting these functions. If they are built as modules, they will become modules with exported functions, if they are builtins they will become builtins. Fixes: 4f04f68e1598 ("mtd: physmap_of: fixup gemini/versatile dependencies") Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Make the Kconfig entries tristate so they can follow the config of the main code portions. - Use the IS_ENABLED() macro from to determine whether a certain function is available for builtin OR module. This is finally the silver bullet: allyes and allmod builds fine on x86_64. --- drivers/mtd/maps/Kconfig | 4 ++-- drivers/mtd/maps/Makefile | 8 ++------ drivers/mtd/maps/physmap_of_gemini.c | 2 ++ drivers/mtd/maps/physmap_of_gemini.h | 3 ++- drivers/mtd/maps/physmap_of_versatile.c | 2 ++ drivers/mtd/maps/physmap_of_versatile.h | 3 ++- 6 files changed, 12 insertions(+), 10 deletions(-) -- 2.9.3 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 542fdf8e81fa..a4fa2f725d33 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig @@ -75,7 +75,7 @@ config MTD_PHYSMAP_OF taken from OF device tree. config MTD_PHYSMAP_OF_VERSATILE - bool "ARM Versatile OF-based physical memory map handling" + tristate "ARM Versatile OF-based physical memory map handling" depends on MTD_PHYSMAP_OF depends on MFD_SYSCON default y if (ARCH_INTEGRATOR || ARCH_VERSATILE || ARCH_REALVIEW) @@ -85,7 +85,7 @@ config MTD_PHYSMAP_OF_VERSATILE the flash can be taken out of write protection. config MTD_PHYSMAP_OF_GEMINI - bool "Cortina Gemini OF-based physical memory map handling" + tristate "Cortina Gemini OF-based physical memory map handling" depends on MTD_PHYSMAP_OF depends on MFD_SYSCON default ARCH_GEMINI diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index aef1846b4de2..608bdd37ac99 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile @@ -17,12 +17,8 @@ obj-$(CONFIG_MTD_CK804XROM) += ck804xrom.o obj-$(CONFIG_MTD_TSUNAMI) += tsunami_flash.o obj-$(CONFIG_MTD_PXA2XX) += pxa2xx-flash.o obj-$(CONFIG_MTD_PHYSMAP) += physmap.o -ifdef CONFIG_MTD_PHYSMAP_OF_VERSATILE -physmap_of-objs += physmap_of_versatile.o -endif -ifdef CONFIG_MTD_PHYSMAP_OF_GEMINI -physmap_of-objs += physmap_of_gemini.o -endif +obj-$(CONFIG_MTD_PHYSMAP_OF_VERSATILE) += physmap_of_versatile.o +obj-$(CONFIG_MTD_PHYSMAP_OF_GEMINI) += physmap_of_gemini.o obj-$(CONFIG_MTD_PHYSMAP_OF) += physmap_of.o obj-$(CONFIG_MTD_PISMO) += pismo.o obj-$(CONFIG_MTD_PMC_MSP_EVM) += pmcmsp-flash.o diff --git a/drivers/mtd/maps/physmap_of_gemini.c b/drivers/mtd/maps/physmap_of_gemini.c index 9d371cd728ea..616f162c4da1 100644 --- a/drivers/mtd/maps/physmap_of_gemini.c +++ b/drivers/mtd/maps/physmap_of_gemini.c @@ -6,6 +6,7 @@ * detect and set it up when booting on this platform. */ #include +#include #include #include #include @@ -115,3 +116,4 @@ int of_flash_probe_gemini(struct platform_device *pdev, return 0; } +EXPORT_SYMBOL(of_flash_probe_gemini); diff --git a/drivers/mtd/maps/physmap_of_gemini.h b/drivers/mtd/maps/physmap_of_gemini.h index c675025288dd..99eaa8637f79 100644 --- a/drivers/mtd/maps/physmap_of_gemini.h +++ b/drivers/mtd/maps/physmap_of_gemini.h @@ -1,7 +1,8 @@ #include #include +#include -#ifdef CONFIG_MTD_PHYSMAP_OF_GEMINI +#if IS_ENABLED(CONFIG_MTD_PHYSMAP_OF_GEMINI) int of_flash_probe_gemini(struct platform_device *pdev, struct device_node *np, struct map_info *map); diff --git a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c index 8c6ccded9be8..0583876bc053 100644 --- a/drivers/mtd/maps/physmap_of_versatile.c +++ b/drivers/mtd/maps/physmap_of_versatile.c @@ -21,6 +21,7 @@ */ #include #include +#include #include #include #include @@ -252,3 +253,4 @@ int of_flash_probe_versatile(struct platform_device *pdev, return 0; } +EXPORT_SYMBOL(of_flash_probe_versatile); diff --git a/drivers/mtd/maps/physmap_of_versatile.h b/drivers/mtd/maps/physmap_of_versatile.h index 5b86f6dc6b3d..f4b5fa7476ac 100644 --- a/drivers/mtd/maps/physmap_of_versatile.h +++ b/drivers/mtd/maps/physmap_of_versatile.h @@ -1,7 +1,8 @@ #include #include +#include -#ifdef CONFIG_MTD_PHYSMAP_OF_VERSATILE +#if IS_ENABLED(CONFIG_MTD_PHYSMAP_OF_VERSATILE) int of_flash_probe_versatile(struct platform_device *pdev, struct device_node *np, struct map_info *map);