From patchwork Wed Apr 4 10:38:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 132808 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4887323ljb; Wed, 4 Apr 2018 03:39:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/S3v3+wwwHLYgih2ECKESJ1P4AF8r2WYR8Tf9Fr04XPLni4Me684nQTZ7/731ysZStVw7q X-Received: by 2002:a17:902:2468:: with SMTP id m37-v6mr17651139plg.388.1522838364466; Wed, 04 Apr 2018 03:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522838364; cv=none; d=google.com; s=arc-20160816; b=GsiKqtRETjB0zJV2zss1eBeHwRLwlkxdFfn9HKoCFMIr3IuIHDhnQT4lpk8OMehm6v hbdMAo/gL0rG5igPKU8x3u48tbAv/d3O14Kr+C3QjI9fefZDcgUBD5T2GW2YAcCXgnwI RmzZ2F7s6dA8l/MIVr3XPCuHcq+pqDeEOn4SIpN0k8QnEq92m/QqlNBETn1/4zRjaXcf lvGeQMcGXO0Y409Ywpfm05spY+loH5YwI/rBvpC3/88ZRW2LL+QglyH0TzYnyZRG+YP8 VvMteiHcp8KGDygHLcwSiAcBV3Q2Kn4dACnkOlyMaBJg9M2lbMrGjKAXhgXDXMDWuqs7 hijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8NevFyUFWyIqtCbnevquWjFBGiCg5o9I8MIh1XeiI9w=; b=P4sIvRd+82Xsg5NAzZccx04z0mfbPyefq81WoatqhYHLKBkePd7mLMpAQan5JSd9Jw znCZ7fVtctLJdAJslfwqa7jS8JomB28oP1G8Rwl55G6s3MxlA5pnXwyRHTfwV5pJ2C8R EBPF/RvUjhlpl1dvkhDUTq6lIUnU+W0KOQsTxLBFnn49fTHvc4rUZtp2pjivm8HIqmaY OoMZr7/680H3wK+fC/bjD26N3b2zDDvOk4eNWyupIXjMeD8671j+Hem7DSUEG4OUNoHv B4dvbJ4b7byJB0pt8KXmwppqgb2EG4q4tfeclfCS/bwUx6gIbXPC5OKgiXIZZydL9tzW i/Gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si3783362pfh.272.2018.04.04.03.39.24; Wed, 04 Apr 2018 03:39:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751432AbeDDKjV (ORCPT + 29 others); Wed, 4 Apr 2018 06:39:21 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:60361 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750814AbeDDKjU (ORCPT ); Wed, 4 Apr 2018 06:39:20 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Ltm1V-1eKkfy1Hdt-011DCH; Wed, 04 Apr 2018 12:39:03 +0200 From: Arnd Bergmann To: Srinivas Kandagatla Cc: Arnd Bergmann , Mike Looijmans , Florian Fainelli , Andrew Lunn , "David S . Miller" , netdev@vger.kernel.org, Greg Kroah-Hartman , Oleksij Rempel , Martin Blumenstingl , linux-kernel@vger.kernel.org Subject: [PATCH] [net] nvmem: disallow modular CONFIG_NVMEM Date: Wed, 4 Apr 2018 12:38:40 +0200 Message-Id: <20180404103900.4090118-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:DCKwEpTRpFjb0G38RPIan3YlqFf/VpzSCyAdeoB6BZg6M1Xgmw4 uFslSiGhwjBIlVn6mGPZg/nZuUUTMLHpLXuyXe3BOCaaPVxm8yQNqeXpDH8/JQbvCy5YJZj Z17NgJBceR4K5YjwuRL7/BOu1wAW89oPnJpvioK2AZAEz3rORy3iSdGRRChHOrNR9j53hws VdaheQLAfuqfqDpUhijCg== X-UI-Out-Filterresults: notjunk:1; V01:K0:nVqrTKZqhR4=:W0XKG7aiWFVmIDdTDPi3q7 UVTz5dK7Ois1j0o28EQEIB24B8Xque1xXNqyx9iV5pMXGV1J9sh4tG/HlpCaYT0cyCFENLgAC LOcjR2Wq60vUUdU1kacgB4HN7B688LEq4gIUWyyOH0NCA6JR9DP6jlb/SW94TC4y5W/DfCCaZ DqpTLFsHCcKinLOtlmC5KHWD80ZLsr8k8EhTSV2k3dWNSKFK3t/WhchVvUh9vtVN/3y8osZFN hU7dWzK9D9EDv41nCWNON4p8nwDGRCL/vtcsUAiCdQjmr3RTgpTRbgGSU+O5rPG5ptgjVLtGl Bh75LUDGYd8ArIFo0K7L73a08AbdCgUWe6PBzSk4oMigQslwWBCrjOyoOJjQLRJ8w3n8aA8mf FSCawmzoULceBhBqUGmnvfSNhPi7t1yOlF1uRJk1xmaX5j0vxdzjDgQqvPppXbYMWpR1iti4F CkEc1f9fN6epW6EkdZ6JXRauz7ERrz1jTE0LPa7IcjFbWM/imd4JAxv+WbWd4IAKrkl71SkrZ F0QXhKdlJyOswQboqKMBNsGb1NgAZsyikjXT5NMjN1cRT/dQCaWqofShyswetIOC5blmdXIL9 1w6j8LjfAqXLGXMo0evhCyqiZ8eX8xvbBcaQBdjVxGDFrxxcHVq2b8GLI6w64xbb6b3Xp/qMf UsqzTZF/UKL7Ro1GyuyQ8tzts2ILtO9Gqkr5l3cVgLn+gDRTTD047wssn/9i6pKiYGeeNbC// 1EqHGk+k247us0s886WsitBNLcxCQe+8FMH3Sw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new of_get_nvmem_mac_address() helper function causes a link error with CONFIG_NVMEM=m: drivers/of/of_net.o: In function `of_get_nvmem_mac_address': of_net.c:(.text+0x168): undefined reference to `of_nvmem_cell_get' of_net.c:(.text+0x19c): undefined reference to `nvmem_cell_read' of_net.c:(.text+0x1a8): undefined reference to `nvmem_cell_put' I could not come up with a good solution for this, as the code is always built-in. Using an #if IS_REACHABLE() check around it would solve the link time issue but then stop it from working in that configuration. Making of_nvmem_cell_get() an inline function could also solve that, but seems a bit ugly since it's somewhat larger than most inline functions, and it would just bring that problem into the callers. Splitting the function into a separate file might be an alternative. This uses the big hammer by making CONFIG_NVMEM itself a 'bool' symbol, which avoids the problem entirely but makes the vmlinux larger for anyone that might use NVMEM support but doesn't need it built-in otherwise. Fixes: 9217e566bdee ("of_net: Implement of_get_nvmem_mac_address helper") Cc: Mike Looijmans Cc: Florian Fainelli Cc: Andrew Lunn Cc: David S. Miller Cc: netdev@vger.kernel.org Signed-off-by: Arnd Bergmann --- The problem arrived through the networking tree, but it's now in mainline, so the fix could go through either tree --- drivers/nvmem/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 Acked-by: Mike Looijmans diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 5f9bc787d634..1090924efdb1 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -1,5 +1,5 @@ menuconfig NVMEM - tristate "NVMEM Support" + bool "NVMEM Support" help Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES...