From patchwork Tue Dec 2 20:46:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 5424381 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D23B3BEEA8 for ; Tue, 2 Dec 2014 20:46:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED0FF202AE for ; Tue, 2 Dec 2014 20:46:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF88620253 for ; Tue, 2 Dec 2014 20:46:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933006AbaLBUqb (ORCPT ); Tue, 2 Dec 2014 15:46:31 -0500 Received: from utopia.booyaka.com ([74.50.51.50]:35907 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932179AbaLBUqa (ORCPT ); Tue, 2 Dec 2014 15:46:30 -0500 Received: (qmail 32339 invoked by uid 1019); 2 Dec 2014 20:46:28 -0000 Date: Tue, 2 Dec 2014 20:46:28 +0000 (UTC) From: Paul Walmsley To: linux-spi@vger.kernel.org, pantelis.antoniou@konsulko.com, grant.likely@linaro.org cc: linux-kernel@vger.kernel.org, broonie@kernel.org, fengguang.wu@intel.com Subject: [PATCH] spi/of: fix warning due to missing CONFIG_OF_DYNAMIC dependency Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 linux-next commit ce79d54ae447d65117303ca9f61ffe9dcbc2465d ("spi/of: Add OF notifier handler") is causing the following warning during boot: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/spi/spi.c:2424 spi_init+0x8c/0xc8() Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc6-next-20141201+ #77 Hardware name: NVIDIA Tegra132 Norrin (DT) Call trace: [] dump_backtrace+0x0/0x12c [] show_stack+0x10/0x1c [] dump_stack+0x74/0xc4 [] warn_slowpath_common+0x98/0xcc [] warn_slowpath_null+0x14/0x20 [] spi_init+0x88/0xc8 [] do_one_initcall+0x88/0x1a8 [] kernel_init_freeable+0x140/0x1e8 [] kernel_init+0xc/0xd4 ---[ end trace 39b2574b2cb43456 ]--- This was reported by Fengguang Wu on November 22: https://lkml.org/lkml/2014/11/22/109 and November 28: http://www.gossamer-threads.com/lists/linux/kernel/2059702 The warning is generated when the code tests the return value of of_reconfig_notifier_register(), which returns -EINVAL. This occurs whenever CONFIG_OF_DYNAMIC is not set. This warning will likely affect any configuration with CONFIG_SPI && CONFIG_OF && !CONFIG_OF_DYNAMIC. Fix by modifying the preceding kernel configuration option test to test for CONFIG_OF_DYNAMIC, not CONFIG_OF. This patch applies on linux-next 20141201. Signed-off-by: Paul Walmsley Cc: Pantelis Antoniou Cc: Grant Likely Cc: Mark Brown Cc: Fengguang Wu --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 8a0e4b006a78..4431a578bd30 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2415,7 +2415,7 @@ static int __init spi_init(void) if (status < 0) goto err2; - if (IS_ENABLED(CONFIG_OF)) + if (IS_ENABLED(CONFIG_OF_DYNAMIC)) WARN_ON(of_reconfig_notifier_register(&spi_of_notifier)); return 0;