Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5598255imm; Mon, 23 Jul 2018 02:36:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeizytvGQPt32C5sp206WfxJehELRj0YKQNOqroHmA33EzthbCmVLnFkIh5Gq7urCMM+/cO X-Received: by 2002:a62:f610:: with SMTP id x16-v6mr12594488pfh.169.1532338579922; Mon, 23 Jul 2018 02:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532338579; cv=none; d=google.com; s=arc-20160816; b=aBMY7mGAUmkMhgJHDKnGsTgtcrQ1Nu8FS8y7QETik+ESsyD49oiuiDEZ7cEY/O2NWr sgweXGlb39It9i+5A1LEtuW/hmlfxGHwHJesNusVsBfydes+u6XhJ7WoxhEsCaIdLV2e YA7gutkNOR7AfWhh0MlUeSL9XqHNIqAtfbVwreh3l/OaYT8QwUsxWPmrGEuGW581reJc UB4X//XI4zXIO1oAVkSYR/Yp4FLc2g60E1TqLFR2phhReBbq+/hCbaB0KCteLNHsoYLW Mec0qYANJP4gB+qyRtwspg+7HExSZU/ajMjJrv2mRd2v6pe54C4Wtx9ZGgWwZAQ37ECb EEGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=efbnVRUR7iRAArMuxIsJRcpCswVAQzKA//9khjmBDrA=; b=iAQUD6sYNlbKQB8b3Vox3Tv+ibKQ8jmWUBJjG+Lhpy8hAEbyHl/arJVE1CGdLT6ZDi rF2QDpiZqKf2+JE42PYJC5F5c/y+1QsYqrRQk21UhxxENdYXAyFKzLJEjDHGCsyBkSVs PVWPaNzFNttr1/sreF7SVin6p4v9WG3FDnSQaF+cOZCvPSrg2nvN/q8N6Y577nzYxO9w 4Uupz47EGet6HXv6qO0dhiSnUNEFtU04LElIZmlzlRcmN0uTGxGtQyIttlLbjLZ5i5u+ /vD79rHTlyjooZoicVbcyrAV0p/zisAwFvJl0wiEJjKYYLgPSo5NxgzJyH9Z8N7sW8FB hBCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WQtx9AMF; 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 n64-v6si8934129pgn.247.2018.07.23.02.36.05; Mon, 23 Jul 2018 02:36:19 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WQtx9AMF; 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 S2388217AbeGWKfE (ORCPT + 99 others); Mon, 23 Jul 2018 06:35:04 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:46255 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388080AbeGWKfD (ORCPT ); Mon, 23 Jul 2018 06:35:03 -0400 Received: by mail-qk0-f195.google.com with SMTP id o2-v6so9734801qkc.13; Mon, 23 Jul 2018 02:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=efbnVRUR7iRAArMuxIsJRcpCswVAQzKA//9khjmBDrA=; b=WQtx9AMFY006zHiM73sP9jUkQzqLFZZjHaA0PzBk+ZgK86CMEg2tjNLBBaRAlZ6URl DcO14v57hlIkFetJuu6hrxfnjSjMZEzFWfQ+upbXklSJmIPbB1xd1Hd33mTQ2+RgvH0s FfGXxjfGpX2kvdWJVmj0kBL/O/3a5KqljLQgkmSKtzbr1VLDIN+Sbu129ArK3VPD8ahA tOpjTi+jSI++mHRLZ63v1SlxhDgqnxP4lje4dJrNmMWM0m/2NP+7uA9MHs2iTOq8HJyD OIPcMpmr22XSYSFrcKVe8SfdRXoHUbQUhhUGti19Jr5oMZucN8WQjCbydmUq1vWVqBoI 1BWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=efbnVRUR7iRAArMuxIsJRcpCswVAQzKA//9khjmBDrA=; b=IWrMeGfEceYx3SkGF3WZzua9byxlQZJNkztxddyL6eIRzIFuf4yID67OG02bd+GY1D XAdfewaLE9OunMJyYjs2paDuCRoyKc73fcdQr6eEhVWDCtEJgAXOlSs4VYPed32+5RdM +Kf5KzxYqcWgrnqRzl6odmq2mM2/Vb7PLlO3bn48R9Hn6LagkER0/ZPMUcEtwX5WW2zC +Sv2pGGg8vL8mhLVNTwet8MeWWl9eR06/LmAiZXvEY7eKchZMMh1Vd2mach8+7Wkalv0 WsPDvZe2Y0mfHXSjexBBm29ObsOVsxTmwm+J1c+VQCZ4if/kkJZEUmEzspgjW20QH4/O isUA== X-Gm-Message-State: AOUpUlFPiigTUJUz+2ohENxHs4bkGDrMx8eYXavxF2ovkNsxj88V+WuJ /nX7p1P9rVyNsVwF4e4D9rQ79d1gms3cOvFfmpQ= X-Received: by 2002:a37:2a65:: with SMTP id q98-v6mr10470375qkh.174.1532338484487; Mon, 23 Jul 2018 02:34:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:967d:0:0:0:0:0 with HTTP; Mon, 23 Jul 2018 02:34:43 -0700 (PDT) In-Reply-To: <20180722082939.2de739f1@bbrezillon> References: <20180721200049.7553-1-anders.roxell@linaro.org> <20180722082939.2de739f1@bbrezillon> From: Arnd Bergmann Date: Mon, 23 Jul 2018 11:34:43 +0200 X-Google-Sender-Auth: 1kgq8wsrABrxCoJ15lyTe8l6il0 Message-ID: Subject: Re: [PATCH] drivers/memory/Kconfig: Add CONFIG_OF dependency To: Boris Brezillon Cc: Randy Dunlap , Anders Roxell , Miquel Raynal , Linux Kernel Mailing List , Rob Herring , DTML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 22, 2018 at 8:29 AM, Boris Brezillon wrote: > +Arnd, Rob and the DT ML. > > On Sat, 21 Jul 2018 14:53:47 -0700 > Randy Dunlap wrote: > >> On 07/21/2018 01:00 PM, Anders Roxell wrote: >> > JZ4780_NEMC doesn't depend on OF, and if OF isn't enabled we get this >> > error: >> > drivers/memory/jz4780-nemc.c: In function =E2=80=98jz4780_nemc_num_ban= ks=E2=80=99: >> > drivers/memory/jz4780-nemc.c:72:10: error: implicit declaration of >> > function =E2=80=98of_read_number=E2=80=99; did you mean =E2=80=98down= _read_nested=E2=80=99? >> > [-Werror=3Dimplicit-function-declaration] >> > bank =3D of_read_number(prop, 1); >> > ^~~~~~~~~~~~~~ >> > down_read_nested > > Looks like of.h defines stubs so that people can compile-test without > CONFIG_OF selected. Maybe we should move of_read_number() and > of_read_ulong() out of the #ifdef CONFIG_OF section. That seems fine, though the added dependency seems appropriate here as well. of_read_number() is rarely used, and for the most part in powerpc specific code that is guaranteed to have CONFIG_OF enabled, so it's not that likely to cause many more problems. > Alternatively, we could patch jz4780-nemc.c to not use of_read_number > and instead rely on of_read_property_u32_index() + > of_property_count_elems_of_size() + of_n_{addr,size}_cells(): That seems noticeably longer for no good reason, I'd go with either the header file change you suggested or Anders' patch. Arnd