Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1339082pxb; Fri, 22 Jan 2021 13:08:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2G7P3YO9s2Rhq38hrkSjeDZuPrueE3fbi/v3qcFSRbG4m0EoMMNXhcO1m3XRlA8kgaAvF X-Received: by 2002:a50:852a:: with SMTP id 39mr4703840edr.114.1611349731607; Fri, 22 Jan 2021 13:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611349731; cv=none; d=google.com; s=arc-20160816; b=RNZvsXn6Eq/hOnifEXmHggjykdYLtObAanASLKvyTFSjZnzCPLvOtWvO+c+i9o0MDO 22JCQds2txX+PeAWwavD6qi/sraAhMQonujNKuhFAektJUED0pCvciyBPa6PnsKAC+x/ aT7F7+aSFih39t94ceGD+cwP6xQl1kk/EePD8mX+Ogxoq5ocApTENCJD5lixcpG36rDH I7K4JAsoRFtAki/yIYi3O3MjkXS0EkPC4hdNhaE6RNNlB1Uqoj+ShNczxZG8TLIthWNj Mex/CkwCQsyWtZmlYpcbFKTMJBJnRhTleVE1IQ4Nvf66pLO4+L7XemNt2w0N9JTl8zmV fmcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0+FVmVKDe2MoonBQPJh+WFy/vq4SQqjBfSX0+brJygs=; b=Lm7pDlGChvWOHdJoX0+BlTAMTVYI2R647WfT5UbrkCKxFJuMITIueuPP3aRtwBSSsK La4eMFsLaTEwlzGpIeXRtymb79GSeKGtoWg0jxO8wCnWxzIwzmuVEJCCPN4NbLMTro0N fzTX6GbqE/5gMwSHa8YzIlcL9RVKb8AFwnr2XxWMiaTPehBb7tYqxsw+oNFCZpikajDd ZRFp4k76Hlg3UOw2f5PZTfER8q5OUChrLTFbrabm5WX+VJxca1s5myr40TuTK9kmrTFC hrfMBUzbVzs6tVWE6dfh76Rpiu4iGX2//q2fBcRYhT4qo3cPKdEH94H5WUAHWQl/hxDu UU+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ednwYABf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si4151717edt.564.2021.01.22.13.08.27; Fri, 22 Jan 2021 13:08:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ednwYABf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728368AbhAVVHI (ORCPT + 99 others); Fri, 22 Jan 2021 16:07:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729342AbhAVVGF (ORCPT ); Fri, 22 Jan 2021 16:06:05 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5346C06174A; Fri, 22 Jan 2021 13:05:25 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id p18so4624029pgm.11; Fri, 22 Jan 2021 13:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0+FVmVKDe2MoonBQPJh+WFy/vq4SQqjBfSX0+brJygs=; b=ednwYABfe8sA98UvTPMN9T40IOylLOQQZEvo1t931jl8Ag18tNevC8GGNYrtw8P+9d TW2wcMWVJc9Q4WQHAjeHxIbmqW02Pxi6Wc9ryNsYVspnG6U6eSVFqN5IILNNHuvAY9vx L/rPzb1DgrIgL8kmD2h14jfMiwPav2cajp2KJ68khkwDTivvY+6EVoDhXl5Tl4UjQcQw Fd2zpXr3UWCsJQGRht9xpZK20E2TTWZc04Qf/8D7oL/Cc7KAXI/EmVnteeFUB3um/Hf6 NpSjApWZ6kc5x47GfYUOaelT7E5L4ZOadaipihqU+juQQ01Lv7pmwScMpx0CfXg86hcL jmWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0+FVmVKDe2MoonBQPJh+WFy/vq4SQqjBfSX0+brJygs=; b=JLMcvnCMx7WOANKVJaj6L814r3UF9YuSp0DtaIJ+ozDv4PuY6SlSbiCnWLMOJ643Vd HQ1qV1AH1ac8awgyTNIVdjq0aFYpoWXX/TWQJMDv3UDfaEWbzwlmeUsnz604W2ZMCjLm QSLXsjt1ME1zycGa/1w42MSpb4NjNsunNVpHyoM0g20z6rOZewWqRIbWETT3IcBQgIm1 0nAilKDz6zI4XNliTZsTPIokOQIgzAkGSYvKqswH7LfQcMhGrELvvVzPV9SNHs5oH0fs NgoA9K+glEh7gufctsfl8tBxJJj9cBjgfLQIcgqJimiItkHf3lmgy6pbfS3U35KST+NT wOKQ== X-Gm-Message-State: AOAM532HA5X7t9aTe7CyfVYd3Hqv7oDz96S4+I6v1oBeVtfttcDdZ/ad kdK99x370tuoyCtkAtDceBfmQA9z1ESpSV71Pso= X-Received: by 2002:a62:5a86:0:b029:1ae:6b45:b6a9 with SMTP id o128-20020a625a860000b02901ae6b45b6a9mr6566386pfb.7.1611349525011; Fri, 22 Jan 2021 13:05:25 -0800 (PST) MIME-Version: 1.0 References: <20210112134054.342-1-calvin.johnson@oss.nxp.com> <20210112134054.342-10-calvin.johnson@oss.nxp.com> <20210112180343.GI4077@smile.fi.intel.com> In-Reply-To: From: Andy Shevchenko Date: Fri, 22 Jan 2021 23:06:14 +0200 Message-ID: Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id() To: Saravana Kannan Cc: "Rafael J. Wysocki" , Calvin Johnson , Grant Likely , Jeremy Linton , Andrew Lunn , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Diana Madalina Craciun , LKML , netdev , Laurentiu Tudor , ACPI Devel Maling List , "linux.cj" , linux-arm-kernel , Bartosz Golaszewski , Greg Kroah-Hartman , Laurent Pinchart , Randy Dunlap Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 10:59 PM Saravana Kannan wrote: > On Fri, Jan 22, 2021 at 8:34 AM Rafael J. Wysocki wrote: > > On Wed, Jan 20, 2021 at 9:01 PM Saravana Kannan wrote: > > > On Wed, Jan 20, 2021 at 11:15 AM Rafael J. Wysocki wrote: > > > I'd rather this new function be an ops instead of a bunch of #ifdef or > > > if (acpi) checks. Thoughts? > > > > Well, it looks more like a helper function than like an op and I'm not > > even sure how many potential users of it will expect that _ADR should > > be evaluated in the absence of the "reg" property. > > > > It's just that the "reg" property happens to be kind of an _ADR > > equivalent in this particular binding AFAICS. > > I agree it is not clear how useful this helper function is going to be. > > But in general, to me, any time the wrapper/helper functions in > drivers/base/property.c need to do something like this: > > if (ACPI) > ACPI specific code > if (OF) > OF specific code > > I think the code should be pushed to the fwnode ops. That's one of the > main point of fwnode. So that firmware specific stuff is done by > firmware specific code. Also, when adding support for new firmware, > it's pretty clear what support the firmware needs to implement. > Instead of having to go fix up a bunch of code all over the place. Wishful thinking. In the very case of GPIO it's related to framework using headers local to framework. Are you suggesting to open its guts to the entire wild world? I don't think it's a good idea. You see, here we have different layering POD types, which are natural and quite low level that ops suits best for them and quite different resource types like GPIO. And the latter is closer to certain framework rather than to POD handling cases. > So fwnode_ops->get_id() would be the OP ACPI and OF would implement. > And then we can have a wrapper in drivers/base/property.c. -- With Best Regards, Andy Shevchenko