Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1340021pxb; Fri, 22 Jan 2021 13:10:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwplCbQF6q6+3vx3F+Z7oSb5LduljfAYKLzvzVw89q7oQo8qRxYT2RDZjH//AMWKl3i6gg X-Received: by 2002:a17:907:9710:: with SMTP id jg16mr4379856ejc.286.1611349824318; Fri, 22 Jan 2021 13:10:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611349824; cv=none; d=google.com; s=arc-20160816; b=bc2/7VVsLS5yWxh2NK3zIthrKcxi1VLDdPTDQnT8YwVyAPuCod/koUtx48Aqw+ocpr 82kWMVp7mQHLHWWx4dunqiGYE9eL+8NvN1p1rbeEWpmpSR2Vzv/eTE+lSKZ76itLuwN4 47aS0QEN8HvLjaE0UYTQt2EDnWD3+n6eCFGBLuwAB6vWNHHOMo5IZDyyx8En1cYHcIX5 yPjnWEhjoVkJwS1vVFdfGsx9Bo9P8xAxU+fGKY5y0SiZ6ZtDQWWh1QOllgUVObiOeuzv BnWr1ZjXUPSY8Z7O9DxeHt9aubNmuBmj3le30xLMD18IoMXMqNFuTZ4om7LLgb8NQde+ oPfQ== 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=qVc/JMkhbZ642gWanQRDHxa/CH0+8991b/z+xpWJCVE=; b=tuo6raTm0XjJZC5OxA2EM4dUdyHW68cRl05yBJKqMJkeNc/YhxlkMGrNx96RJ0Vpry Q5sQkB0w0hOa0LZcSR3sE5Z/sG7MOpMzItkM2LvtLC/WWCQ9q0hNWz/gD1X2a7jilFax E0aCmqv81FYaYQERF8kxjdLUTzT9DCR+p/q5oJ2RBC4o+Ubx/bB2irvW2ECtqxxgbJep 3jB7kzuzA6ts6TpNZxZ9u3LW/HJw3OmEyPPUddrCAYxAMJFLjsv9zC6JnYujUCL44ESE Uhfwuh128Vhb+7CBGFGeqH9KTmGFsWPz71JAKy6WMeNeLJ7pPQ75VED/Xt3xp8rDbf9g NRSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sv6yjs1f; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk1si3421224ejb.343.2021.01.22.13.09.59; Fri, 22 Jan 2021 13:10:24 -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=@google.com header.s=20161025 header.b=sv6yjs1f; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728447AbhAVVJQ (ORCPT + 99 others); Fri, 22 Jan 2021 16:09:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729648AbhAVVIr (ORCPT ); Fri, 22 Jan 2021 16:08:47 -0500 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD10C0613D6 for ; Fri, 22 Jan 2021 13:08:06 -0800 (PST) Received: by mail-yb1-xb29.google.com with SMTP id i141so6818755yba.0 for ; Fri, 22 Jan 2021 13:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qVc/JMkhbZ642gWanQRDHxa/CH0+8991b/z+xpWJCVE=; b=sv6yjs1f0h/jilFnfWEYscV2TwPHz046JX1vja4M1fRL7/hPcAimzjsx09ndnGML1+ R1dYHaoAPYi/shuH4sdW1QblpzxI+u7SkGi3MNPi+El6gPb+WhnRHFnDiaz77PyejxFE bnlC79MJ79AWbokEVsWQaIgH4NFvplailCmo3cPt7yPvl3blKaOiFXfBUpasnfE4IK9r 7wvBHXRMAI9Qdf83Jkdbgx9puJ8gL8d0sUEX1S8mMSLen7WXn9rifkY8zRhBpmsCmZJt nzUKXEqWgZeUtPVfru5jeTmT17iJVykkgsqIfG57gyHnRFVvjTp2xRRjltHv51NQUBgf HgIQ== 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=qVc/JMkhbZ642gWanQRDHxa/CH0+8991b/z+xpWJCVE=; b=r9WaGsrtM6qpBgLFciXMB4Zq36jo5yPp6+7FayZeb5HZ34jr1Jyd7pVsENQS0qoVYU FJGkp3Ne/ukkaLYS+Xp9ESPtsn25qKd+jHIsw+7R9EyKJkhyHW0X2pXeFxMonatFn3sq dNoECSCPNtJ1I52KK02nuj3TPfC+dZ96dTKxFOqiq3HORxkdhKxm9ISv+XrCl3byMZFE sbhHblOx+udAV/H9mX4ISifbATQz61sr9x4zwfJ/6VfcjlPXaXwqKksAwm/hfgVF7ewD DUdrbC7ebrbAzQ8e0syuHeKNFnO60q+HUnMfUFfSROQSC+LmJW5u+eJm2k8hJjcsUmtW 2+yA== X-Gm-Message-State: AOAM531muhhjJehfBx+9ot5zHcHkqird/bK6VWiiV8uIfOGDrVIPpu9r aANmr+jrP5HFmno4PYXJyI7TB1863zOIBwEibT4jFQ== X-Received: by 2002:a25:3345:: with SMTP id z66mr9256594ybz.466.1611349685124; Fri, 22 Jan 2021 13:08:05 -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: Saravana Kannan Date: Fri, 22 Jan 2021 13:07:29 -0800 Message-ID: Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id() To: Andy Shevchenko 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 1:05 PM Andy Shevchenko wrote: > > 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? What are you even talking about? How is whatever you are saying remotely related to getting an "id" for a fwnode? > I don't think it's a good idea. You see, here we have different > layering POD types, POD? > 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. > -Saravana