From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA1CCC4360C for ; Fri, 22 Jan 2021 17:56:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F6B023AFC for ; Fri, 22 Jan 2021 17:56:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729524AbhAVR0x (ORCPT ); Fri, 22 Jan 2021 12:26:53 -0500 Received: from mga01.intel.com ([192.55.52.88]:29322 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729805AbhAVRNF (ORCPT ); Fri, 22 Jan 2021 12:13:05 -0500 IronPort-SDR: avJ7zOLMX10DdlUu09FWHPMf29Mapoe8xdie2xT8q6sX1OTz4qg8azh3t1/XAT3hwps+wr40U6 oyHDcnYWOV8A== X-IronPort-AV: E=McAfee;i="6000,8403,9872"; a="198233178" X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="198233178" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 09:12:20 -0800 IronPort-SDR: yqnk3jB27YouuRgleyQwzREUrl8c55y4GP7bS5wDjn5bCM+PbC1W/kJLjfowYeSQPfjqW48Wr7 9v4ATfdIQ8WA== X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="571191463" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 09:12:13 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1l2zzm-009DzL-8d; Fri, 22 Jan 2021 19:13:14 +0200 Date: Fri, 22 Jan 2021 19:13:14 +0200 From: Andy Shevchenko To: "Rafael J. Wysocki" Cc: 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 , Saravana Kannan , Randy Dunlap , "linux.cj" , Diana Madalina Craciun , ACPI Devel Maling List , Linux ARM , Linux Kernel Mailing List , netdev , Laurentiu Tudor , Bartosz Golaszewski , Greg Kroah-Hartman , Kieran Bingham , Laurent Pinchart Subject: Re: [net-next PATCH v4 09/15] device property: Introduce fwnode_get_id() Message-ID: References: <20210122154300.7628-1-calvin.johnson@oss.nxp.com> <20210122154300.7628-10-calvin.johnson@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 05:40:41PM +0100, Rafael J. Wysocki wrote: > On Fri, Jan 22, 2021 at 4:46 PM Calvin Johnson > wrote: > > > > Using fwnode_get_id(), get the reg property value for DT node > > or get the _ADR object value for ACPI node. > > So I'm not really sure if this is going to be generically useful. > > First of all, the meaning of the _ADR return value is specific to a > given bus type (e.g. the PCI encoding of it is different from the I2C > encoding of it) and it just happens to be matching the definition of > the "reg" property for this particular binding. > IOW, not everyone may expect the "reg" property and the _ADR return > value to have the same encoding and belong to the same set of values, I have counted three or even four attempts to open code exact this scenario in the past couple of years. And I have no idea where to put a common base for them so they will not duplicate this in each case. > so maybe put this function somewhere closer to the code that's going > to use it, because it seems to be kind of specific to this particular > use case? -- With Best Regards, Andy Shevchenko